From df77d95d87f30f466413d9a24703243479ac9bd1 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Mon, 2 Sep 2019 13:58:18 +0200 Subject: [PATCH] [hellfire] SetPlrAnims --- Source/player.cpp | 72 ++++++++++++++++++++++++++++++++++++++++++++--- Source/player.h | 2 +- 2 files changed, 69 insertions(+), 5 deletions(-) diff --git a/Source/player.cpp b/Source/player.cpp index 769b86c49..6791a8e1e 100644 --- a/Source/player.cpp +++ b/Source/player.cpp @@ -50,10 +50,15 @@ int plrxoff[9] = { 0, 2, 0, 2, 1, 0, 1, 2, 1 }; int plryoff[9] = { 0, 2, 2, 0, 1, 1, 0, 1, 2 }; int plrxoff2[9] = { 0, 1, 0, 1, 2, 0, 1, 2, 2 }; int plryoff2[9] = { 0, 0, 1, 1, 0, 2, 2, 1, 2 }; -char PlrGFXAnimLens[3][11] = { +char PlrGFXAnimLens[][11] = { { 10, 16, 8, 2, 20, 20, 6, 20, 8, 9, 14 }, { 8, 18, 8, 4, 20, 16, 7, 20, 8, 10, 12 }, - { 8, 16, 8, 6, 20, 12, 8, 20, 8, 12, 8 } + { 8, 16, 8, 6, 20, 12, 8, 20, 8, 12, 8 }, +#ifdef HELLFIRE + { 8, 16, 8, 3, 20, 18, 6, 20, 8, 12, 13 }, + { 8, 18, 8, 4, 20, 16, 7, 20, 8, 10, 12 }, + { 10, 16, 8, 2, 20, 20, 6, 20, 8, 9, 14 }, +#endif }; int PWVel[3][3] = { { 2048, 1024, 512 }, @@ -460,8 +465,6 @@ void SetPlrAnims(int pnum) app_fatal("SetPlrAnims: illegal player %d", pnum); } - pc = plr[pnum]._pClass; - plr[pnum]._pNWidth = 96; plr[pnum]._pWWidth = 96; plr[pnum]._pAWidth = 128; @@ -470,6 +473,8 @@ void SetPlrAnims(int pnum) plr[pnum]._pDWidth = 128; plr[pnum]._pBWidth = 96; + pc = plr[pnum]._pClass; + if (leveltype == DTYPE_TOWN) { plr[pnum]._pNFrames = PlrGFXAnimLens[pc][7]; plr[pnum]._pWFrames = PlrGFXAnimLens[pc][8]; @@ -527,6 +532,65 @@ void SetPlrAnims(int pnum) plr[pnum]._pAFrames = 24; plr[pnum]._pAFNum = 16; } +#endif +#ifdef HELLFIRE + } else if (pc == PC_MONK) { + plr[pnum]._pNWidth = 112; + plr[pnum]._pWWidth = 112; + plr[pnum]._pAWidth = 130; + plr[pnum]._pHWidth = 98; + plr[pnum]._pSWidth = 114; + plr[pnum]._pDWidth = 160; + plr[pnum]._pBWidth = 98; + + switch (gn) { + case ANIM_ID_UNARMED: + case ANIM_ID_UNARMED_SHIELD: + plr[pnum]._pAFrames = 12; + plr[pnum]._pAFNum = 7; + break; + case ANIM_ID_BOW: + plr[pnum]._pAFrames = 20; + plr[pnum]._pAFNum = 14; + break; + case ANIM_ID_AXE: + plr[pnum]._pAFrames = 23; + plr[pnum]._pAFNum = 14; + break; + case ANIM_ID_STAFF: + plr[pnum]._pAFrames = 13; + plr[pnum]._pAFNum = 8; + break; + } + } else if (pc == PC_BARD) { + if (gn == ANIM_ID_AXE) { + plr[pnum]._pAFrames = 22; + plr[pnum]._pAFNum = 13; + } else if (gn == ANIM_ID_BOW) { + plr[pnum]._pAFrames = 12; + plr[pnum]._pAFNum = 11; + } else if (gn == ANIM_ID_STAFF) { + plr[pnum]._pAFrames = 16; + plr[pnum]._pAFNum = 11; + } else if (gn == ANIM_ID_SWORD_SHIELD || gn == ANIM_ID_SWORD) { + plr[pnum]._pAFrames = 10; + } + } else if (pc == PC_BARBARIAN) { + if (gn == ANIM_ID_AXE) { + plr[pnum]._pAFrames = 20; + plr[pnum]._pAFNum = 8; + } else if (gn == ANIM_ID_BOW) { + if (leveltype != DTYPE_TOWN) { + plr[pnum]._pNFrames = 8; + } + plr[pnum]._pAWidth = 96; + plr[pnum]._pAFNum = 11; + } else if (gn == ANIM_ID_STAFF) { + plr[pnum]._pAFrames = 16; + plr[pnum]._pAFNum = 11; + } else if (gn == ANIM_ID_MACE || gn == ANIM_ID_MACE_SHIELD) { + plr[pnum]._pAFNum = 8; + } #endif } } diff --git a/Source/player.h b/Source/player.h index daa306012..df3085d85 100644 --- a/Source/player.h +++ b/Source/player.h @@ -125,7 +125,7 @@ extern int plrxoff[9]; extern int plryoff[9]; extern int plrxoff2[9]; extern int plryoff2[9]; -extern char PlrGFXAnimLens[3][11]; +extern char PlrGFXAnimLens[][11]; extern int PWVel[3][3]; extern int AnimLenFromClass[3]; extern int StrengthTbl[3];