convert line ends
[canaan.git] / prj / cam / src / deepc / player / dpcmelab.cpp
blobab3e257c9d941d3716fe4bdb1cde513d0980cdc1
1 /*
2 @Copyright Looking Glass Studios, Inc.
3 1996,1997,1998,1999,2000 Unpublished Work.
4 */
6 ///////////////////////////////////////////////////////
8 #include <dpcmelab.h>
10 #include <lg.h>
11 #include <comtools.h>
12 #include <appagg.h>
14 #include <ai.h>
15 #include <aiapiiai.h>
17 #include <plyrhdlr.h>
18 #include <config.h>
19 #include <matrixs.h>
20 #include <objtype.h>
21 #include <command.h>
22 #include <playrobj.h>
23 #include <timer.h>
24 #include <headmove.h>
25 #include <schema.h>
26 #include <mtagvals.h>
27 #include <creatext.h>
29 #include <phcore.h>
30 #include <phmods.h>
31 #include <phmod.h>
32 #include <phctrl.h>
33 #include <phmoapi.h>
35 #include <invlimb.h>
37 #include <plyrtype.h>
38 #include <plycbllm.h> // PlayerSwitchMode
39 #include <crattach.h>
40 #include <matrixc.h>
42 #include <dpcmelee.h>
43 #include <weapon.h>
44 #include <weaphalo.h>
45 #include <weapprop.h>
46 #include <weapreac.h>
47 #include <weapcb.h>
49 #include <rendprop.h>
50 #include <objpos.h>
51 #include <plyablt_.h>
52 #include <dpcmel_.h>
53 #include <dpccret.h>
55 #include <mvrflags.h>
57 #include <plyrmode.h>
59 #include <mprintf.h>
61 // Must be last header
62 #include <dbmem.h>
64 static sPlayerAbilityDesc g_meleeAbilityDesc={ {"armsw2"},kDPCCRTYPE_PlayerLimb,kPSS_Begin,kPSS_NumSkills,g_meleeSkillDesc};
65 cPlayerMeleeAbility g_meleeAbility(&g_meleeAbilityDesc);
67 int g_meleeStartActionSkill[kPlayerMeleeNumActions] =
69 kPSS_WindupMediumLeft,
70 kPSS_WindupLong,
73 cPlayerMeleeAbility::cPlayerMeleeAbility(const sPlayerAbilityDesc *pDesc)
75 DefaultInit(pDesc);
78 int cPlayerMeleeAbility::GetNextSkillID(int skillID, ePlayerInput input, tPlayerActionType actType)
80 if(skillID<0||skillID>=m_Desc.nSkills)
81 return kSkillInvalid;
83 if(input==kPlyrInput_Start)
85 sSkillConnectDesc *pConnect=&m_Desc.pSkills[skillID].connect;
86 int nextSkill=pConnect->nextIfStart;
87 if(nextSkill&&actType!=kPlayerActionTypeInvalid)
89 // get special start action for type
90 // XXX this may need to be more sophisticated - check if you would
91 // otherwise be idling or something. Only really made to work for
92 // Melee swings and blocks.
93 // only call if startaction would otherwise at least have you
94 // doing _something_ HACK HACK HACK KJ 1/98
96 // note this leaves nextSkill unchanged unless there is a start action
97 nextSkill=g_meleeStartActionSkill[actType];
99 return nextSkill;
100 } else
102 return DefaultGetNextSkillID(skillID, input, actType);
106 void cPlayerMeleeAbility::SetupSkill(int skillID)
108 if ((skillID == kPSS_SwingMediumLeft) || (skillID == kPSS_SwingLong))
109 if (GetPlayerMode() == kPM_Crouch)
110 PlayerMotionActivate(kMoWeaponSwingCrouch);
111 else
112 PlayerMotionActivate(kMoWeaponSwing);
114 DefaultSetupSkill(skillID);
117 BOOL cPlayerMeleeAbility::GetSoundSchemaName(int skillID,Label *pName)
119 return cPlayerAbility::GetSoundSchemaName(skillID, pName);