Skip to content

Commit

Permalink
EOC bonanza
Browse files Browse the repository at this point in the history
  • Loading branch information
Karol1223 committed Jul 1, 2023
1 parent 25658db commit 1bd0b45
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 45 deletions.
6 changes: 5 additions & 1 deletion data/json/effect_on_condition.json
Original file line number Diff line number Diff line change
Expand Up @@ -1303,13 +1303,17 @@
"type": "effect_on_condition",
"id": "dermatik_pregnacy_early",
"condition": { "u_has_effect": "dermatik" },
"effect": [ { "u_add_effect": "formication", "duration": "15 minutes" } ]
"effect": [
{ "u_add_effect": "formication", "duration": "15 minutes" },
{ "queue_eocs": "dermatik_pregnacy", "time_in_future": "1 days" }
]
},
{
"type": "effect_on_condition",
"id": "dermatik_pregnacy",
"condition": { "u_has_effect": "dermatik" },
"effect": [
{ "u_message": "Your flesh crawls… A larva tears through your flesh and begins to emerge!", "type": "bad" },
{ "u_spawn_monster": "mon_dermatik_larva", "real_count": 1, "min_radius": 1, "max_radius": 4 },
{ "u_lose_effect": "dermatik" }
]
Expand Down
2 changes: 1 addition & 1 deletion data/json/effects.json
Original file line number Diff line number Diff line change
Expand Up @@ -4273,6 +4273,6 @@
"enchantments": [ { "values": [ { "value": "HUNGER", "multiply": 1.5 }, { "value": "METABOLISM", "multiply": 1.5 } ] } ],
"rating": "bad",
"remove_message": "The wriggling under your skin stops.",
"blood_analysis_description": "test"
"blood_analysis_description": "Unknown parasitic infection"
}
]
44 changes: 1 addition & 43 deletions src/player_hardcoded_effects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1224,49 +1224,7 @@ void Character::hardcoded_effects( effect &it )
map &here = get_map();
Character &player_character = get_player_character();
creature_tracker &creatures = get_creature_tracker();
if( id == effect_dermatik ) {
bool triggered = false;
int formication_chance = 3600;
if( dur < 4_hours ) {
formication_chance += 14400 - to_turns<int>( dur );
}
if( one_in( formication_chance ) ) {
schedule_effect( effect_formication, 60_minutes, bp );
}
if( dur < 1_days && one_in( 14400 ) ) {
vomit();
}
if( dur > 1_days ) {
// Spawn some larvae!
// Choose how many insects; more for large characters
///\EFFECT_STR_MAX increases number of insects hatched from dermatik infection
int num_insects = rng( 1, std::min( 3, str_max / 3 ) );
apply_damage( nullptr, bp, rng( 2, 4 ) * num_insects );
// Figure out where they may be placed
add_msg_player_or_npc( m_bad,
_( "Your flesh crawls; insects tear through the flesh and begin to emerge!" ),
_( "Insects begin to emerge from <npcname>'s skin!" ) );
for( ; num_insects > 0; num_insects-- ) {
if( monster *const grub = g->place_critter_around( mon_dermatik_larva, pos(), 1 ) ) {
if( one_in( 3 ) ) {
grub->friendly = -1;
grub->add_effect( effect_pet, 1_turns, true );
}
}
}
get_event_bus().send<event_type::dermatik_eggs_hatch>( getID() );
schedule_effect_removal( effect_formication, bp );
moves -= 600;
triggered = true;
}
if( triggered ) {
// Set ourselves up for removal
it.set_duration( 0_turns );
} else {
// Count duration up
it.mod_duration( 1_turns );
}
} else if( id == effect_formication ) {
if( id == effect_formication ) {
///\EFFECT_INT decreases occurrence of itching from formication effect
if( x_in_y( intense, 600 + 300 * get_int() ) && !has_effect( effect_narcosis ) ) {
if( !is_npc() ) {
Expand Down

0 comments on commit 1bd0b45

Please sign in to comment.