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

Work towards Deprecating "melee_cut" #57913

Merged
merged 17 commits into from
May 27, 2022

Conversation

Maleclypse
Copy link
Member

@Maleclypse Maleclypse commented May 25, 2022

Summary

None

Purpose of change

Make all bonus damage follow the "melee_damage" array format. I believe this will eliminate confusion in monster making by standardizing. Standardizing should also help prepare the way for jsonized damage types in post 0.G.

Describe the solution

Well the capture wildcards find and replace failed but it gave me the idea of replacing everything in a way that allows me to easily go in and modify each line and I can then easily check when I've completed a given file. But it's basically just find and replace.

Describe alternatives you've considered

Not doing this, but I think it's important.

Testing

Tests should continue to fail extensively until I've fixed everything I broke in the original find and replace :)

Additional context

This won't break third party mods but if melee_cut is phased out it will.

@github-actions github-actions bot added [JSON] Changes (can be) made in JSON Mods Issues related to mods or modding Mods: Aftershock Anything to do with the Aftershock mod Mods: Dark Skies Anything to do with Dark Skies Above, alien invasion mod with no zombies Mods: Dinomod Anything to do with the Dinoclysm mod (DinoMod) Mods: Magiclysm Anything to do with the Magiclysm mod Monsters Monsters both friendly and unfriendly. astyled astyled PR, label is assigned by github actions labels May 25, 2022
@Maleclypse
Copy link
Member Author

I think I'll need to add the tropicataclysm folder to my project folders and do the same for their monsters.

@Maleclypse
Copy link
Member Author

@dseguin You might know a way for me to do the find and replace with the old value for "melee_cut": '*', wildcarded so it replaces easily?

@NetSysFire
Copy link
Member

NetSysFire commented May 25, 2022

If this is on Linux (or at least WSL) you can use sed:

sed 's/"melee_cut": \([0-9]\+\),/"melee_damage": [ { "damage_type": "cut", "amount": \1 } ],/g'

Anything that uses regex replace can do this.

@LyleSY
Copy link
Contributor

LyleSY commented May 25, 2022

Is it/will it be possible then to change some of these damage types? Right now all dinos do bonus cut damage if they do bonus damage, but it would be better if the damage type matched the dino. For example a dino that rams or smashes should be bashing.

@Maleclypse
Copy link
Member Author

Is it/will it be possible then to change some of these damage types? Right now all dinos do bonus cut damage if they do bonus damage, but it would be better if the damage type matched the dino. For example a dino that rams or smashes should be bashing.

It's already possible but no one has gone through and updated old monsters to use "melee_damage": [ { "damage_type": "cut", "amount": 1 } ], the damage type in that array can be any existing damage type and that's why I think it's best to deprecate "melee_cut" because it's existence always ends up confusing me when I want to add bonus damage of other types.

Copy link
Contributor

@LyleSY LyleSY left a comment

Choose a reason for hiding this comment

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

DinoMod stuff looks good. I'll add specific damage types in a followup PR, I'll try and pull in some vanilla ones too

@Maleclypse Maleclypse marked this pull request as draft May 25, 2022 17:36
@Maleclypse
Copy link
Member Author

Need to understand if melee_damage is supported in proportional and relative and if not I will need to undo any of the changes to those two values and melee_cut won't be able to be fully deprecated yet.

data/json/monsters/fungus_zombie.json Outdated Show resolved Hide resolved
data/json/monsters/fungus_zombie.json Outdated Show resolved Hide resolved
data/mods/DinoMod/obsolete/monsters.json Outdated Show resolved Hide resolved
data/json/monsters/fungus_zombie.json Outdated Show resolved Hide resolved
data/json/monsters/zanimal_upgrade.json Outdated Show resolved Hide resolved
data/json/monsters/zanimal_upgrade.json Outdated Show resolved Hide resolved
data/json/monsters/zed_acid.json Outdated Show resolved Hide resolved
data/json/monsters/nether.json Outdated Show resolved Hide resolved
data/json/monsters/mutant_mammal.json Outdated Show resolved Hide resolved
data/json/monsters/reptile_amphibian.json Outdated Show resolved Hide resolved
data/json/monsters/yrax.json Outdated Show resolved Hide resolved
data/json/monsters/zed_ferrous.json Outdated Show resolved Hide resolved
data/mods/DinoMod/monsters/zed-dinosaur.json Outdated Show resolved Hide resolved
data/mods/DinoMod/monsters/zed-dinosaur.json Outdated Show resolved Hide resolved
data/mods/Magiclysm/monsters/demon_spider.json Outdated Show resolved Hide resolved
data/mods/Magiclysm/monsters/monsters.json Outdated Show resolved Hide resolved
data/mods/Magiclysm/monsters/monsters.json Outdated Show resolved Hide resolved
@github-actions
Copy link
Contributor

Spell checker encountered unrecognized words in the in-game text added in this pull request. See below for details.

Click to expand
  • mavka
  • mavkas

This alert is automatically generated. You can simply disregard if this is inaccurate, or (optionally) you can also add the new words to tools/spell_checker/dictionary.txt so they will not trigger an alert next time.

@github-actions github-actions bot added the json-styled JSON lint passed, label assigned by github actions label May 25, 2022
@Maleclypse Maleclypse changed the title Deprecate "melee_cut" Work towards Deprecating "melee_cut" May 25, 2022
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label May 25, 2022
@Maleclypse Maleclypse marked this pull request as ready for review May 25, 2022 23:08
@dseguin dseguin merged commit 42bae28 into CleverRaven:master May 27, 2022
chaosvolt added a commit to chaosvolt/nocts_cata_mod that referenced this pull request May 27, 2022
CleverRaven/Cataclysm-DDA#57913 means it's likely a matter of time before code support for the old method is stripped out of DDA, plus it's probably good to switch anyway.
chaosvolt added a commit to chaosvolt/cdda-arcana-mod that referenced this pull request May 27, 2022
@Maleclypse Maleclypse deleted the Deprecate-melee_cut branch December 14, 2022 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions Mods: Aftershock Anything to do with the Aftershock mod Mods: Dark Skies Anything to do with Dark Skies Above, alien invasion mod with no zombies Mods: Dinomod Anything to do with the Dinoclysm mod (DinoMod) Mods: Magiclysm Anything to do with the Magiclysm mod Mods Issues related to mods or modding Monsters Monsters both friendly and unfriendly.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants