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

Renamed death states and used enums for animations #3682

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion src/power_hand.c
Original file line number Diff line number Diff line change
Expand Up @@ -1348,7 +1348,7 @@ TbBool place_thing_in_power_hand(struct Thing *thing, PlayerNumber plyr_idx)
if (creature_affected_by_spell(thing, SplK_Chicken))
i = convert_td_iso(122);
else
i = get_creature_anim(thing, 9);
i = get_creature_anim(thing, CGI_PowerGrab);
set_thing_draw(thing, i, 256, -1, -1, 0, ODC_Default);
} else
if (thing_is_object(thing))
Expand Down
2 changes: 1 addition & 1 deletion src/spdigger_stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -1956,7 +1956,7 @@ int add_unclaimed_dead_bodies_to_imp_stack(struct Dungeon *dungeon, int max_task
if ( (dungeon->digger_stack_length >= DIGGER_TASK_MAX_COUNT) || (remain_num <= 0) ) {
break;
}
if (!thing_is_dragged_or_pulled(thing) && (thing->active_state == DCrSt_RigorMortis)
if (!thing_is_dragged_or_pulled(thing) && (thing->active_state == DCrSt_Dead)
&& (!corpse_laid_to_rest(thing)) && corpse_is_rottable(thing))
{
if (thing_revealed(thing, dungeon->owner))
Expand Down
18 changes: 9 additions & 9 deletions src/thing_corpses.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ TbBool corpse_ready_for_collection(const struct Thing* thing)
return false;
if (thing_is_dragged_or_pulled(thing))
return false;
if (thing->active_state != DCrSt_RigorMortis)
if (thing->active_state != DCrSt_Dead)
return false;
return true;
}
Expand Down Expand Up @@ -224,7 +224,7 @@ TngUpdateRet update_dead_creature(struct Thing *thing)
long corpse_age;
if ((thing->alloc_flags & TAlF_IsDragged) == 0)
{
if (thing->active_state == DCrSt_DramaticDying)
if (thing->active_state == DCrSt_Dying)
{
struct Coord3d pos;
pos.x.val = thing->mappos.x.val;
Expand All @@ -237,8 +237,8 @@ TngUpdateRet update_dead_creature(struct Thing *thing)
if (thing->health > 0)
thing->health--;
if (thing->health <= 0) {
thing->active_state = DCrSt_RigorMortis;
long i = get_creature_anim(thing, 16);
thing->active_state = DCrSt_Dead;
long i = get_creature_anim(thing, CGI_DropDead);
set_thing_draw(thing, i, 64, -1, 1, 0, ODC_Default);
}
} else
Expand Down Expand Up @@ -466,14 +466,14 @@ struct Thing *create_dead_creature(const struct Coord3d *pos, ThingModel model,
unsigned long k;
switch (crpscondition)
{
case DCrSt_RigorMortis:
thing->active_state = DCrSt_RigorMortis;
k = get_creature_anim(thing, 17);
case DCrSt_Dead:
thing->active_state = DCrSt_Dead;
k = get_creature_anim(thing, CGI_DeadSplat);
set_thing_draw(thing, k, 256, game.conf.crtr_conf.sprite_size, 0, 0, ODC_Default);
break;
default:
thing->active_state = DCrSt_DramaticDying;
k = get_creature_anim(thing, 15);
thing->active_state = DCrSt_Dying;
k = get_creature_anim(thing, CGI_Scream);
set_thing_draw(thing, k, 128, game.conf.crtr_conf.sprite_size, 0, 0, ODC_Default);
thing->health = 3 * get_lifespan_of_animation(thing->anim_sprite, thing->anim_speed);
play_creature_sound(thing, CrSnd_Die, 3, 0);
Expand Down
4 changes: 2 additions & 2 deletions src/thing_corpses.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ struct Dungeon;

enum DeadCreatureStates {
DCrSt_Unused = 0,
DCrSt_DramaticDying,
DCrSt_RigorMortis,
DCrSt_Dying,
DCrSt_Dead,
};

#pragma pack()
Expand Down
12 changes: 6 additions & 6 deletions src/thing_creature.c
Original file line number Diff line number Diff line change
Expand Up @@ -2493,7 +2493,7 @@ struct Thing* thing_death_normal(struct Thing *thing)
memaccl.x.val = thing->veloc_base.x.val;
memaccl.y.val = thing->veloc_base.y.val;
memaccl.z.val = thing->veloc_base.z.val;
struct Thing* deadtng = destroy_creature_and_create_corpse(thing, DCrSt_DramaticDying);
struct Thing* deadtng = destroy_creature_and_create_corpse(thing, DCrSt_Dying);
if (thing_is_invalid(deadtng))
{
ERRORLOG("Cannot create dead thing");
Expand Down Expand Up @@ -2533,7 +2533,7 @@ struct Thing* thing_death_flesh_explosion(struct Thing *thing)
pos.z.val = thing->mappos.z.val+i;
create_effect(&pos, TngEff_Blood4, thing->owner);
}
struct Thing* deadtng = destroy_creature_and_create_corpse(thing, DCrSt_RigorMortis);
struct Thing* deadtng = destroy_creature_and_create_corpse(thing, DCrSt_Dead);
if (thing_is_invalid(deadtng))
{
ERRORLOG("Cannot create dead thing");
Expand Down Expand Up @@ -2568,7 +2568,7 @@ struct Thing* thing_death_gas_and_flesh_explosion(struct Thing *thing)
pos.y.val = thing->mappos.y.val;
pos.z.val = thing->mappos.z.val+i;
create_effect(&pos, TngEff_Gas3, thing->owner);
struct Thing* deadtng = destroy_creature_and_create_corpse(thing, DCrSt_RigorMortis);
struct Thing* deadtng = destroy_creature_and_create_corpse(thing, DCrSt_Dead);
if (thing_is_invalid(deadtng))
{
ERRORLOG("Cannot create dead thing");
Expand All @@ -2595,7 +2595,7 @@ struct Thing* thing_death_smoke_explosion(struct Thing *thing)
pos.y.val = thing->mappos.y.val;
pos.z.val = thing->mappos.z.val+i;
create_effect(&pos, TngEff_HarmlessGas1, thing->owner);
struct Thing* deadtng = destroy_creature_and_create_corpse(thing, DCrSt_RigorMortis);
struct Thing* deadtng = destroy_creature_and_create_corpse(thing, DCrSt_Dead);
if (thing_is_invalid(deadtng))
{
ERRORLOG("Cannot create dead thing");
Expand Down Expand Up @@ -2629,7 +2629,7 @@ struct Thing* thing_death_ice_explosion(struct Thing *thing)
pos.z.val = thing->mappos.z.val+i;
create_effect(&pos, TngEff_DeathIceExplosion, thing->owner);
}
struct Thing* deadtng = destroy_creature_and_create_corpse(thing, DCrSt_RigorMortis);
struct Thing* deadtng = destroy_creature_and_create_corpse(thing, DCrSt_Dead);
if (thing_is_invalid(deadtng))
{
ERRORLOG("Cannot create dead thing");
Expand Down Expand Up @@ -4296,7 +4296,7 @@ struct Thing *create_creature(struct Coord3d *pos, ThingModel model, PlayerNumbe
cctrl->shot_shift_x = crstat->shot_shift_x;
cctrl->shot_shift_y = crstat->shot_shift_y;
cctrl->shot_shift_z = crstat->shot_shift_z;
long i = get_creature_anim(crtng, 0);
long i = get_creature_anim(crtng, CGI_Stand);
set_thing_draw(crtng, i, 256, game.conf.crtr_conf.sprite_size, 0, 0, ODC_Default);
cctrl->explevel = 1;
crtng->health = crstat->health;
Expand Down
Loading