diff --git a/src/d_player.h b/src/d_player.h index aa01288487..d8fb75eaef 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -159,6 +159,7 @@ class APlayerChunk : public APlayerPawn enum { PPF_NOTHRUSTWHENINVUL = 1, // Attacks do not thrust the player if they are invulnerable. + PPF_CANSUPERMORPH = 2, // Being remorphed into this class can give you a Tome of Power }; // diff --git a/src/g_shared/a_morph.cpp b/src/g_shared/a_morph.cpp index d3b8d4ac82..a027afcc57 100644 --- a/src/g_shared/a_morph.cpp +++ b/src/g_shared/a_morph.cpp @@ -47,6 +47,13 @@ bool P_MorphPlayer (player_t *activator, player_t *p, const PClass *spawntype, i } if (p->morphTics) { // Player is already a beast + if ((p->mo->GetClass() == spawntype) + && (p->mo->PlayerFlags & PPF_CANSUPERMORPH) + && (p->morphTics < (((duration) ? duration : MORPHTICS) - TICRATE)) + && (p->mo->FindInventory (RUNTIME_CLASS(APowerWeaponLevel2), true) == NULL)) + { // Make a super chicken + p->mo->GiveInventoryType (RUNTIME_CLASS(APowerWeaponLevel2)); + } return false; } if (p->health <= 0) diff --git a/src/thingdef/thingdef_data.cpp b/src/thingdef/thingdef_data.cpp index 751a6a0caf..fe94a2fcc9 100644 --- a/src/thingdef/thingdef_data.cpp +++ b/src/thingdef/thingdef_data.cpp @@ -333,6 +333,7 @@ static FFlagDef PlayerPawnFlags[] = { // PlayerPawn flags DEFINE_FLAG(PPF, NOTHRUSTWHENINVUL, APlayerPawn, PlayerFlags), + DEFINE_FLAG(PPF, CANSUPERMORPH, APlayerPawn, PlayerFlags), }; static const struct FFlagList { const PClass *Type; FFlagDef *Defs; int NumDefs; } FlagLists[] = diff --git a/wadsrc/static/actors/heretic/chicken.txt b/wadsrc/static/actors/heretic/chicken.txt index 2bed5248c9..029dca0141 100644 --- a/wadsrc/static/actors/heretic/chicken.txt +++ b/wadsrc/static/actors/heretic/chicken.txt @@ -68,6 +68,7 @@ ACTOR ChickenPlayer : PlayerPawn native Speed 1 Gravity 0.125 +NOSKIN + +CANSUPERMORPH PainSound "chicken/pain" DeathSound "chicken/death" Player.JumpZ 1