Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: item label can save deployable robot nicknames #4230

Merged
merged 1 commit into from
Feb 18, 2024

Conversation

chaosvolt
Copy link
Member

Purpose of change

Just as a deployable monster's damage condition is saved in its item form and vice versa, a fun lil idea I had was for deployable bots to have their nicknames saved via the item label for their inactive form.

Describe the solution

  1. In iuse_actor.cpp, changed place_monster_iuse::use so that it checks whether the item in question was labeled, and if so assigns it as the deployed monster's nickname.
  2. Conversely, in monster.cpp set monster::to_item so that it checks whether the monster has a unique_name, and if so assigns it to the item being created as a label.

Describe alternatives you've considered

Adding the monster nickname to monster::init_from_item would also work, but it would enable nicknaming zombies by carving their name on the corpse. Dunno if that'd be considered desirable or not.

Testing

  1. Compiled and load-tested.
  2. Spawned in and undeployed a friendly hauler bot, no odd behavior observed.
  3. Scrawled a name on the inactive hauler bot, it correctly deploys nicknamed now.
  4. Undeploy my new friend and observe the item is still labeled.
  5. For bonus lulz, deployed a mininuke hack without the skills to control it, it indeed comes out nicknamed and still eager to banish me to the shadow realm for my hubris.
  6. Checked affected files for astyle.

1
2
3

Additional context

Checklist

@github-actions github-actions bot added the src changes related to source code. label Feb 15, 2024
Copy link
Member

@scarf005 scarf005 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
image

@scarf005 scarf005 merged commit d0765f5 into cataclysmbnteam:main Feb 18, 2024
13 checks passed
@chaosvolt chaosvolt deleted the nickname-your-bots branch February 18, 2024 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
src changes related to source code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants