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

JSONize yugg gene sting #74352

Merged
merged 25 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
23d1515
JSONize yugg gene sting
Maleclypse Jun 6, 2024
a32179b
Update data/json/monster_special_attacks/monster_gun.json
Maleclypse Jun 6, 2024
9c64493
Update generic_guns_validator.py
Maleclypse Jun 6, 2024
3373a62
Merge branch 'JSONIZE-Yugg-attack' of https://github.com/Maleclypse/C…
Maleclypse Jun 6, 2024
01e6612
Apply suggestions from code review
Maleclypse Jun 6, 2024
495114a
Apply suggestions from code review
Maleclypse Jun 6, 2024
608f94f
Update tools/json_tools/generic_guns_validator.py
Maleclypse Jun 6, 2024
543d2c2
Apply suggestions from code review
Maleclypse Jun 6, 2024
0475396
Update data/json/monster_special_attacks/spells.json
Maleclypse Jun 6, 2024
50466db
Update data/json/monsters/nether.json
Maleclypse Jun 6, 2024
d06248d
Apply suggestions from code review
Maleclypse Jun 6, 2024
48c5058
Update data/json/monster_special_attacks/spells.json
Maleclypse Jun 6, 2024
c94fbec
Update nether.json
Maleclypse Jun 7, 2024
5518106
Apply suggestions from code review
Maleclypse Jun 7, 2024
51a5f4b
Update data/json/monster_special_attacks/spells.json
Maleclypse Jun 7, 2024
535d6bb
fix
Maleclypse Jun 7, 2024
d8f38a3
Update data/json/monster_special_attacks/spells.json
Maleclypse Jun 7, 2024
76aec00
Update spells.json
Maleclypse Jun 8, 2024
e2a8d57
Merge branch 'JSONIZE-Yugg-attack' of https://github.com/Maleclypse/C…
Maleclypse Jun 8, 2024
59b002e
Update data/json/monster_special_attacks/spells.json
Maleclypse Jun 12, 2024
d034527
Apply suggestions from code review
Maleclypse Jun 12, 2024
c09e319
Update data/json/monster_special_attacks/spells.json
Maleclypse Jun 12, 2024
753546d
Update data/json/monster_special_attacks/spells.json
GuardianDll Jun 13, 2024
4837839
Update spells.json
Maleclypse Jun 15, 2024
4f3d7c5
Stop Mutation Selector from firing
Maleclypse Jun 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions data/json/monster_special_attacks/spells.json
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,76 @@
"min_field_intensity": 1,
"max_field_intensity": 2
},
{
"type": "SPELL",
"id": "spell_gene_sting",
"name": { "str": "Gene Sting" },
"description": "Yugg attack which causes random mutation.",
"effect": "attack",
"shape": "blast",
"valid_targets": [ "hostile" ],
"min_range": 24,
"max_range": 24,
"sound_description": "ssszziiipp",
"damage_type": "biological",
"min_damage": 5,
"max_damage": 17,
"extra_effects": [ { "id": "spell_gene_sting_selector" } ]
},
{
"id": "spell_gene_sting_selector",
"type": "SPELL",
"name": "Gene Sting Selector",
"description": "The spell fires the EOC for the yugg gene sting. It's a bug if you have it.",
"message": "",
"valid_targets": [ "hostile" ],
"flags": [ "NO_FAIL", "SILENT", "NO_HANDS", "NO_LEGS" ],
"effect": "effect_on_condition",
"effect_str": "EOC_random_mutate",
"shape": "blast",
"max_level": 1
},
{
"type": "effect_on_condition",
"id": "EOC_random_mutate",
"condition": "u_is_character",
"effect": [
{ "set_string_var": "<random_category>", "target_var": { "context_val": "dart_mutation_category" }, "parse_tags": true },
{ "u_mutate_category": { "context_val": "dart_mutation_category" }, "use_vitamins": false }
]
},
{
"type": "snippet",
Maleclypse marked this conversation as resolved.
Show resolved Hide resolved
"category": "<random_category>",
"text": [
{ "text": "CHIMERA", "weight": 6 },
{ "text": "INSECT", "weight": 2 },
{ "text": "ALPHA", "weight": 1 },
{ "text": "URSINE", "weight": 2 },
{ "text": "CHIROPTERAN", "weight": 2 },
{ "text": "BIRD", "weight": 2 },
{ "text": "MEDICAL", "weight": 1 },
{ "text": "LUPINE", "weight": 2 },
{ "text": "RAT", "weight": 2 },
{ "text": "SLIME", "weight": 1 },
{ "text": "PLANT", "weight": 2 },
{ "text": "BATRACHIAN", "weight": 2 },
{ "text": "RAPTOR", "weight": 1 },
{ "text": "MOUSE", "weight": 2 },
{ "text": "CEPHALOPOD", "weight": 2 },
{ "text": "ELFA", "weight": 1 },
{ "text": "FISH", "weight": 2 },
{ "text": "HUMAN", "weight": 1 },
{ "text": "RABBIT", "weight": 2 },
{ "text": "GASTROPOD", "weight": 2 },
{ "text": "BEAST", "weight": 1 },
{ "text": "FELINE", "weight": 1 },
{ "text": "CATTLE", "weight": 1 },
{ "text": "LIZARD", "weight": 1 },
{ "text": "TROGLOBITE", "weight": 1 },
{ "text": "CRUSTACEAN", "weight": 1 }
]
},
{
"type": "SPELL",
"id": "base_portal",
Expand Down
2 changes: 1 addition & 1 deletion data/json/monsters/nether.json
Original file line number Diff line number Diff line change
Expand Up @@ -1428,7 +1428,7 @@
"families": [ "prof_wp_netherium_abomination" ],
"weakpoint_sets": [ "wps_netherium_abomination" ],
"harvest": "meatslug",
"special_attacks": [ [ "GENE_STING", 20 ] ],
"special_attacks": [ { "type": "spell", "spell_data": { "id": "spell_gene_sting", "min_level": 5 }, "cooldown": 160 } ],
"flags": [ "SEES", "SMELLS", "HEARS", "HAS_MIND", "BASHES", "DESTROYS", "POISON", "VENOM", "NO_BREATHE", "DIGS" ],
"armor": { "bash": 6, "electric": 3 }
},
Expand Down
21 changes: 0 additions & 21 deletions src/monattack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2745,27 +2745,6 @@ bool mattack::dogthing( monster *z )
return false;
}

bool mattack::gene_sting( monster *z )
{
const float range = 7.0f;
Creature *target = sting_get_target( z, range );
if( target == nullptr || !( target->is_avatar() || target->is_npc() ) ) {
return false;
}

z->mod_moves( -to_moves<int>( 1_seconds ) * 1.5 );

damage_instance dam = damage_instance();
dam.add_damage( damage_stab, 6, 10, 0.6, 1 );
bool hit = sting_shoot( z, target, dam, range );
if( hit ) {
//Add checks if previous NPC/player conditions are removed
dynamic_cast<Character *>( target )->mutate();
}

return true;
}

bool mattack::para_sting( monster *z )
{
const float range = 4.0f;
Expand Down
1 change: 0 additions & 1 deletion src/monattack.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ bool jackson( monster *z );
bool dance( monster *z );
bool dogthing( monster *z );
bool vortex( monster *z );
bool gene_sting( monster *z );
bool para_sting( monster *z );
bool triffid_growth( monster *z );
bool stare( monster *z );
Expand Down
1 change: 0 additions & 1 deletion src/monstergenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,6 @@ void MonsterGenerator::init_attack()
add_hardcoded_attack( "JACKSON", mattack::jackson );
add_hardcoded_attack( "DANCE", mattack::dance );
add_hardcoded_attack( "DOGTHING", mattack::dogthing );
add_hardcoded_attack( "GENE_STING", mattack::gene_sting );
add_hardcoded_attack( "PARA_STING", mattack::para_sting );
add_hardcoded_attack( "TRIFFID_GROWTH", mattack::triffid_growth );
add_hardcoded_attack( "PHOTOGRAPH", mattack::photograph );
Expand Down
2 changes: 1 addition & 1 deletion src/mutation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1317,7 +1317,7 @@ void Character::mutate_category( const mutation_category_id &cat, const bool use
}

add_msg_debug( debugmode::DF_MUTATION, "mutate_category: mutate_towards category %s", cat.c_str() );
if( select_mutation || mutation_selector( valid, cat, use_vitamins ) ) {
if( select_mutation && mutation_selector( valid, cat, use_vitamins ) ) {
// Stop if mutation properly handled by mutation selector
return;
}
Expand Down
Loading