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

The dissoluted devourer zombie #34057

Merged
merged 45 commits into from
Oct 22, 2019
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
429cb3b
fused zombie start
Aug 19, 2019
3c98420
finish growth effect
Aug 24, 2019
d08384f
finished drops & fixes
Aug 27, 2019
7a071da
Merge branch 'master' into mon-add
Aug 27, 2019
3d6aaa3
basic compiling+loading fixes
Aug 27, 2019
86f0097
misc and fixes
Sep 15, 2019
f37beb6
update
Sep 15, 2019
27a2586
json +c/P fix
Sep 15, 2019
b328142
astyle
Sep 15, 2019
7e4cd82
style, part credit to John-Candlebury.
Sep 15, 2019
98bfba9
json style
Sep 15, 2019
220dc83
fix mult with 0
Sep 15, 2019
a934d99
fix + opti (credits BevapDin)
Sep 16, 2019
d5ddebf
name change+move to crawler+decayed
Sep 16, 2019
bab46dc
slower speed for crawler
Sep 16, 2019
398e477
removed weight/volume effect as fix
Sep 16, 2019
67122dd
balanced shorter evo-times
Sep 16, 2019
e84c207
opti/correction
free-coffee Sep 17, 2019
d074621
opti/correction
free-coffee Sep 17, 2019
69ac265
fix attempt
Sep 17, 2019
2c117d2
Merge branch 'mon-add' of https://github.com/free-coffee/Cataclysm-DD…
Sep 17, 2019
212ed09
correction
free-coffee Sep 17, 2019
a3fc5d2
typo
free-coffee Sep 17, 2019
46c1284
fix attempt
Sep 17, 2019
de5816a
fix attempt
Sep 17, 2019
0e398dc
fix attempt (rename)
Sep 17, 2019
ae1535d
postfix last commit
Sep 17, 2019
9a20c3f
removed evolution on crawler
Sep 17, 2019
b175c20
fix size issue (+readd)
Sep 17, 2019
bce38d2
astyle
Sep 17, 2019
2adb289
fix non-virtual in constructor
Sep 18, 2019
377c3ce
size printing on look-at (growth measure)
Sep 19, 2019
45996f8
correction src/monster.cpp
free-coffee Sep 20, 2019
91d79ac
WIP:start refracturing creature class-tree
Sep 22, 2019
179a5de
forgot pull:
Sep 22, 2019
46c43dc
WIP: redaction & growth-bonus with minimal runt.-data
Sep 29, 2019
0f8646a
fix and optimization
Sep 30, 2019
561d11f
Merge branch 'master' into mon-add
free-coffee Sep 30, 2019
6f17e18
cleanup
Sep 30, 2019
12ac3ed
astyle
Oct 4, 2019
97557ec
cleanup
Oct 4, 2019
0ee3cee
small opti/correction
Oct 4, 2019
1a1adc9
fix small correction
Oct 5, 2019
26f456f
Merge branch 'master' into mon-add
Oct 9, 2019
ecf327d
Merge branch 'master' into mon-add
Oct 12, 2019
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
20 changes: 20 additions & 0 deletions data/json/effects.json
Original file line number Diff line number Diff line change
Expand Up @@ -1746,6 +1746,26 @@
"desc": [ "You've been struck by lightning, and feel... different." ],
"base_mods": { "speed_mod": [ 50 ] }
},
{
"type": "effect_type",
"id": "grown_of_fuse",
"name": [ "Grown of Fusion" ],
"desc": [ "AI effect to increase stats after fusing with another critter. 1 stack means one absorbed max_hp." ],
"//": "stats modified by the zombie_fuse special attack.",
"//1": "scaling:",
"//2": "/48 HP: +0,5 melee_skill, +0,5 dode_skill (unexpected movement), +5 Speed (bigger steps&more to attack with), +4 bash",
free-coffee marked this conversation as resolved.
Show resolved Hide resolved
"//3": "/160 HP: +1 size",
"max_intensity": 480,
"base_mods": { "hit_mod": [ 0.0104 ], "dodge_mod": [ 0.0104 ], "speed_mod": [ 0.1042 ], "bash_mod": [ 0.08333 ] },
"scaling_mods": {
"hit_mod": [ 0.0104 ],
"dodge_mod": [ 0.0104 ],
"speed_mod": [ 0.1042 ],
"bash_mod": [ 0.08333 ],
"size_mod": [ 0.00625 ]
},
"int_decay_step": 0
},
{
"type": "effect_type",
"id": "has_og_comm_freq"
Expand Down
52 changes: 52 additions & 0 deletions data/json/monsters/monsters.json
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,56 @@
"FILTHY"
]
},
{
"id": "mon_devourer",
"type": "MONSTER",
"name": "dissoluted devourer",
"description": "Human bodies fused together into a colossus with heads and limbs sticking out of its bloated body. You may have trouble estimating its healthiness and its capabilities might change.",
"default_faction": "zombie",
"bodytype": "human",
"species": [ "ZOMBIE", "HUMAN" ],
"diff": 8,
"volume": "92500 ml",
"weight": 120000,
"hp": 112,
"speed": 60,
"material": [ "flesh" ],
"symbol": "Z",
"color": "dark_gray_yellow",
"aggression": 100,
"morale": 100,
"melee_skill": 4,
"melee_dice": 3,
"melee_dice_sides": 3,
"melee_cut": 0,
"armor_bash": 5,
"armor_cut": 5,
"vision_night": 3,
"harvest": "zombie",
"special_attacks": [ [ "GRAB", 7 ], [ "scratch", 20 ], [ "ZOMBIE_FUSE", 80 ] ],
"death_drops": {
"subtype": "collection",
"groups": [ "default_zombie_death_drops", "default_zombie_death_drops", "default_zombie_death_drops" ]
},
"death_function": [ "SPLATTER", "NORMAL" ],
"flags": [
"SEES",
"HEARS",
"SMELLS",
"STUMBLES",
"WARM",
"BASHES",
"GROUP_BASH",
"POISON",
"NO_BREATHE",
"REVIVES",
"BILE_BLOOD",
"PUSH_MON",
"PATH_AVOID_DANGER_1",
"FILTHY",
"REGENERATES_1"
]
},
{
"id": "mon_breather",
"type": "MONSTER",
Expand Down Expand Up @@ -811,6 +861,7 @@
"harvest": "zombie_leather",
"fear_triggers": [ "HURT", "FIRE" ],
"death_function": [ "NORMAL" ],
"upgrades": { "half_life": 35, "into": "mon_devourer" },
"flags": [ "SEES", "HEARS", "SMELLS", "WARM", "BASHES", "GROUP_BASH", "POISON", "HUMAN" ]
},
{
Expand Down Expand Up @@ -4671,6 +4722,7 @@
"death_drops": "default_zombie_death_drops",
"death_function": [ "NORMAL" ],
"burn_into": "mon_zombie_scorched",
"upgrades": { "half_life": 23, "into": "mon_devourer" },
"flags": [
"SEES",
"HEARS",
Expand Down
8 changes: 4 additions & 4 deletions src/creature.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ struct trap;

enum m_size : int {
MS_TINY = 0, // Squirrel
MS_SMALL, // Dog
MS_MEDIUM, // Human
MS_LARGE, // Cow
MS_HUGE // TAAAANK
MS_SMALL = 1, // Dog
MS_MEDIUM = 2, // Human
MS_LARGE = 3, // Cow
MS_HUGE = 4 // TAAAANK
};

enum FacingDirection {
Expand Down
13 changes: 13 additions & 0 deletions src/effect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,14 @@ bool effect_type::load_mod_data( JsonObject &jo, const std::string &member )
extract_effect( j, mod_data, "healing_head", member, "HEAL_HEAD", "amount" );
extract_effect( j, mod_data, "healing_torso", member, "HEAL_TORSO", "amount" );

// creature stats mod
extract_effect( j, mod_data, "dodge_mod", member, "DODGE", "min" );
extract_effect( j, mod_data, "block_mod", member, "BLOCK", "min" );
extract_effect( j, mod_data, "hit_mod", member, "HIT", "min" );
extract_effect( j, mod_data, "bash_mod", member, "BASH", "min" );
extract_effect( j, mod_data, "cut_mod", member, "CUT", "min" );
extract_effect( j, mod_data, "size_mod", member, "SIZE", "min" );

return true;
} else {
return false;
Expand Down Expand Up @@ -465,6 +473,11 @@ bool effect_type::load_decay_msgs( JsonObject &jo, const std::string &member )
return false;
}

int effect_type::get_max_intensity() const
{
return max_intensity;
}

effect effect::null_effect;

bool effect::is_null() const
Expand Down
3 changes: 3 additions & 0 deletions src/effect.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ class effect_type
/** Registers the effect in the global map */
static void register_ma_buff_effect( const effect_type &eff );

/** Returns the maximum intensity of this type. */
int get_max_intensity() const;

protected:
int max_intensity;
int max_effective_intensity;
Expand Down
31 changes: 31 additions & 0 deletions src/monattack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ const efftype_id effect_fungus( "fungus" );
const efftype_id effect_glowing( "glowing" );
const efftype_id effect_got_checked( "got_checked" );
const efftype_id effect_grabbed( "grabbed" );
const efftype_id effect_grown_of_fuse( "grown_of_fuse" );
const efftype_id effect_grabbing( "grabbing" );
const efftype_id effect_infected( "infected" );
const efftype_id effect_laserlocked( "laserlocked" );
Expand Down Expand Up @@ -5283,6 +5284,36 @@ bool mattack::stretch_attack( monster *z )
return true;
}

bool mattack::zombie_fuse( monster *z )
{
monster *critter = nullptr;
for( const tripoint &p : g->m.points_in_radius( z->pos(), 1 ) ) {
critter = g->critter_at<monster>( p );
if( critter != nullptr && critter->faction == z->faction
free-coffee marked this conversation as resolved.
Show resolved Hide resolved
&& critter != z && critter->get_size() <= z->get_size() ) {
break;
}
}

if( critter == nullptr ||
( z->get_hp() + critter->get_hp() > z->get_hp_max() +
effect_grown_of_fuse.obj().get_max_intensity() ) ) {
return false;
}
if( g->u.sees( *z ) ) {
add_msg( _( "The %1$s fuses with the %2$s." ),
critter->name(),
z->name() );
}
z->moves -= 200;
z->add_effect( effect_grown_of_fuse, 10_days, num_bp, true,
critter->get_hp_max() + z->get_effect( effect_grown_of_fuse ).get_intensity() );
z->heal( critter->get_hp(), true );
critter->death_drops = false;
critter->die( z );
return true;
}

bool mattack::doot( monster *z )
{
z->moves -= 300;
Expand Down
1 change: 1 addition & 0 deletions src/monattack.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ bool kamikaze( monster *z );
bool grenadier( monster *z );
bool grenadier_elite( monster *z );
bool doot( monster *z );
bool zombie_fuse( monster *z );

void taze( monster *z, Creature *target );
void rifle( monster *z, Creature *target ); // Automated M4
Expand Down
25 changes: 24 additions & 1 deletion src/monster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1874,6 +1874,7 @@ void monster::reset_bonuses()
effect_cache.reset();

Creature::reset_bonuses();
size_bonus = 0;
}

void monster::reset_stats()
Expand Down Expand Up @@ -2259,6 +2260,13 @@ void monster::process_one_effect( effect &it, bool is_new )
};

mod_speed_bonus( get_effect( "SPEED", reduced ) );
mod_dodge_bonus( get_effect( "DODGE", reduced ) );
mod_block_bonus( get_effect( "BLOCK", reduced ) );
mod_hit_bonus( get_effect( "HIT", reduced ) );
mod_bash_bonus( get_effect( "BASH", reduced ) );
mod_cut_bonus( get_effect( "CUT", reduced ) );
mod_size_bonus( get_effect( "SIZE", reduced ) );


int val = get_effect( "HURT", reduced );
if( val > 0 ) {
Expand Down Expand Up @@ -2492,9 +2500,24 @@ field_type_id monster::gibType() const
return type->gibType();
}

int monster::get_size_bonus() const
{
return size_bonus;
}

void monster::set_size_bonus( int nsize )
{
size_bonus = nsize;
}

void monster::mod_size_bonus( int nsize )
{
size_bonus += nsize;
}

m_size monster::get_size() const
{
return type->size;
return m_size( type->size + get_size_bonus() );
}

units::mass monster::get_weight() const
Expand Down
6 changes: 5 additions & 1 deletion src/monster.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ class monster : public Creature
int get_hp_max( hp_part ) const override;
int get_hp_max() const override;
int hp_percentage() const override;
int get_size_bonus() const;
void set_size_bonus( int nsize );
void mod_size_bonus( int nsize );

// Access
std::string get_name() const override;
Expand Down Expand Up @@ -377,7 +380,7 @@ class monster : public Creature
/** Resets stats, and applies effects in an idempotent manner */
void reset_stats() override;

void die( Creature *killer ) override; //this is the die from Creature, it calls kill_mon
void die( Creature *killer ) override;
void drop_items_on_death();

// Other
Expand Down Expand Up @@ -512,6 +515,7 @@ class monster : public Creature
tripoint goal;
tripoint position;
bool dead;
int size_bonus;
/** Legacy loading logic for monsters that are packing ammo. **/
void normalize_ammo( int old_ammo );
/** Normal upgrades **/
Expand Down
1 change: 1 addition & 0 deletions src/monstergenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ void MonsterGenerator::init_attack()
add_hardcoded_attack( "GRAB", mattack::grab );
add_hardcoded_attack( "GRAB_DRAG", mattack::grab_drag );
add_hardcoded_attack( "DOOT", mattack::doot );
add_hardcoded_attack( "ZOMBIE_FUSE", mattack::zombie_fuse );
}

void MonsterGenerator::init_defense()
Expand Down