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 12 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
51 changes: 51 additions & 0 deletions data/json/monsters/monsters.json
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@
"special_attacks": [ [ "scratch", 20 ] ],
"death_drops": "default_zombie_items",
"death_function": [ "CONFLAGRATION" ],
"upgrades": { "half_life": 14, "into": "mon_fused" },
John-Candlebury marked this conversation as resolved.
Show resolved Hide resolved
"flags": [
"SEES",
"HEARS",
Expand Down Expand Up @@ -532,6 +533,56 @@
"FILTHY"
]
},
{
"id": "mon_fused",
"type": "MONSTER",
"name": "fused",
free-coffee marked this conversation as resolved.
Show resolved Hide resolved
"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", "GAS" ],
"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
10 changes: 5 additions & 5 deletions src/creature.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ struct pathfinding_settings;
struct trap;

enum m_size : int {
MS_TINY = 0, // Squirrel
MS_SMALL, // Dog
MS_MEDIUM, // Human
MS_LARGE, // Cow
MS_HUGE // TAAAANK
MS_TINY = 1, // Squirrel
MS_SMALL = 2, // Dog
MS_MEDIUM = 3, // Human
MS_LARGE = 4, // Cow
MS_HUGE = 5 // 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
36 changes: 36 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,41 @@ bool mattack::stretch_attack( monster *z )
return true;
}

bool mattack::zombie_fuse( monster *z )
{
const mfaction_id zombo = mfaction_id( "zombie" );
const tripoint zpos = z->pos();
Creature *critter = nullptr;
for( int x = zpos.x - 1; x < zpos.x + 2; x++ ) {
free-coffee marked this conversation as resolved.
Show resolved Hide resolved
for( int y = zpos.y - 1; y < zpos.y + 2; y++ ) {
critter = g->critter_at( tripoint( x, y, zpos.z ) );
free-coffee marked this conversation as resolved.
Show resolved Hide resolved
if( critter != nullptr && critter->is_monster() &&
static_cast<monster *>( critter )->faction == zombo
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 ) ) {
g->u.add_msg_if_player( _( "The %1$s fuses with the %2$s." ),
free-coffee marked this conversation as resolved.
Show resolved Hide resolved
static_cast<monster *>( critter )->name(),
free-coffee marked this conversation as resolved.
Show resolved Hide resolved
z->name() );
}
z->moves -= 200;
z->add_effect( effect_grown_of_fuse, time_duration::from_days( 10 ), num_bp, true,
free-coffee marked this conversation as resolved.
Show resolved Hide resolved
critter->get_hp_max() + z->get_effect( effect_grown_of_fuse ).get_intensity() );
z->heal( critter->get_hp(), true );
static_cast<monster *>( 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
29 changes: 26 additions & 3 deletions 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,19 +2500,34 @@ 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
{
return type->weight;
return units::from_gram( ( units::to_gram( type->weight ) * get_size() ) / type->size );
}

units::volume monster::get_volume() const
{
return type->volume;
return units::from_milliliter( ( units::to_milliliter( type->volume ) * get_size() ) / type->size );
}

void monster::add_msg_if_npc( const std::string &msg ) 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