// Rifle Infantry #define IS_BUILDER #define IS_ARMED #define WEAPON_GUN #define WEAPON_GRENADE #define USE_SUPPRESSION #define USE_PINDOWN_SYSTEM #define USE_FEAR_SYSTEM #define TAK // This is a TAK script #include "constants.h" #include "InfAnimations.h" /*#include "InfSuppressionVars.h" #include "inf_takecover.h" #include "inf_aimpose_run.h" #include "inf_hitbyweapon.h" #include "inf_movecontrolNade.h"*/ piece torso, flare, pelvis, rthigh, lthigh, lleg, rleg, rfoot, lfoot, luparm, lloarm, ground, gun, ruparm, rloarm, head; #ifdef IS_ARMED static-var isAiming, HipAim; #endif #ifdef WEAPON_GRENADE static-var isActiveGrenade; #endif #ifdef USE_PINDOWN_SYSTEM static-var isPinned, PinnedLevel; #endif #ifdef USE_FEAR_SYSTEM static-var FearLevel, removeFearLevel; #endif static-var isTransported, isMoving, isProne, Desync, inAimStance; //static-var bAiming, transported, DecreasingFear, last_pos, bMoving, nade_active, fear, desync, IsProne, DEATH_SPEED, PickDeath, IsPinned, InAimStance, HipAim; #define SIG_AIM1 1 #define SIG_AIM2 2 #define SIG_AIM3 4 #define RIFLE_MUZZLEFLASH UNIT_SFX8 //movement check for anims //#include "Inf_movecheck.h" //#include "Inf_pin_unpin.h" #ifdef IS_ARMED WeaponReady() { if (!(isActiveGrenade OR HipAim)) { INF_WEAPON_READY show gun; } } #ifdef IS_BUILDER StartBuilding(heading,pitch) { set INBUILDSTANCE to 1; } StopBuilding() { set INBUILDSTANCE to 0; } QueryNanoPiece(piecenum) { piecenum = head; } #endif #ifdef WEAPON_GUN AimFromWeapon1(piecenum) { piecenum = head; } QueryWeapon1(piecenum) { piecenum = flare; } AimWeapon1(heading, pitch) { signal SIG_AIM1; set-signal-mask SIG_AIM1; isAiming = TRUE; sleep 100; if (isActiveGrenade OR isPinned) return 0; // unit is in prone stance and not pinned down if (isProne AND FearLevel < PinnedLevel) { //signal RUNSTOP; turn torso to y-axis <0> speed <600>; turn ruparm to x-axis <-85> - pitch speed <480>; turn luparm to x-axis <-140> - pitch speed <400>; turn pelvis to y-axis heading speed <120>; wait-for-turn pelvis around y-axis; isAiming = FALSE; return 1; } if (!isProne) { // unit is moving if (isMoving) { //HipAim=1; turn torso to x-axis <0> - pitch speed <300>; turn torso to y-axis heading speed <300>; INF_AIM_RIFLE_RUNNING wait-for-turn torso around x-axis; wait-for-turn torso around y-axis; isAiming = FALSE; return 1; } // unit is standing still else if (!isMoving AND !isTransported) { //signal RUNSTOP; INF_STAND if (!isAiming) call-script WeaponReady(); turn torso to x-axis <0> - pitch speed <300>; turn torso to y-axis heading speed <300>; INF_AIM_RIFLE_STANDING wait-for-turn torso around x-axis; wait-for-turn torso around y-axis; isAiming = FALSE; return 1; } } // unit is in a transport if (isTransported) { turn torso to x-axis 0-pitch speed <300>; turn pelvis to y-axis heading speed <300>; INF_AIM_RIFLE_TRANSPORTED wait-for-turn torso around x-axis; wait-for-turn pelvis around y-axis; isAiming = FALSE; return 1; } return 0; } FireWeapon1() { if (isProne) { turn ruparm to x-axis <-95> speed <700>; turn luparm to x-axis <-150> speed <700>; emit-sfx RIFLE_MUZZLEFLASH from flare; sleep 20; turn ruparm to x-axis <-85> speed <200>; turn luparm to x-axis <-140> speed <200>; } else { turn ruparm to x-axis <15> speed <700>; turn luparm to x-axis <-75> speed <700>; emit-sfx RIFLE_MUZZLEFLASH from flare; sleep 20; turn ruparm to x-axis <20> speed <200>; turn luparm to x-axis <-70> speed <200>; sleep 50; } } #endif #ifdef WEAPON_GRENADE AimFromWeapon2(piecenum) { piecenum = torso; } QueryWeapon2(piecenum) { piecenum = gun; } AimWeapon2(heading, pitch) { signal SIG_AIM2; set-signal-mask SIG_AIM2; if (isMoving OR isTransported) return 0; turn pelvis to y-axis heading - <30> now; return 1; } FireWeapon2(heading) { if (!isProne) { isActiveGrenade = TRUE; INF_AIM_GRENADE_STANDING isActiveGrenade = FALSE; } else { isActiveGrenade = TRUE; INF_AIM_GRENADE_PRONE isActiveGrenade = FALSE; } } #endif #ifdef WEPAON_FLAGKILLER AimFromWeapon3(piecenum) { piecenum = head; } QueryWeapon3(piecenum) { piecenum = head; } AimWeapon3(heading, pitch) { return 1; } FireWeapon3() { return; } #endif //#include "Inf_death.h" Create() { #ifdef IS_ARMED isAiming = FALSE; HipAim = FALSE; #endif #ifdef WEAPON_GRENADE isActiveGrenade = FALSE; #endif #ifdef USE_PINDOWN_SYSTEM isPinned = FALSE; PinnedLevel = 100; #endif #ifdef USE_FEAR_SYSTEM FearLevel = 0; removeFearLevel = FALSE; #endif isTransported = FALSE; isMoving = FALSE; isProne = FALSE; Desync = rand(1,100); inAimStance = FALSE; hide flare; call-script WeaponReady(); }