1 #using scripts\codescripts\struct;
3 #using scripts\shared\callbacks_shared;
4 #using scripts\shared\clientfield_shared;
5 #using scripts\shared\duplicaterender_mgr;
6 #using scripts\shared\system_shared;
7 #using scripts\shared\util_shared;
9 #using scripts\shared\abilities\_ability_player;
10 #using scripts\shared\abilities\_ability_power;
11 #using scripts\shared\abilities\_ability_util;
13 #insert scripts\shared\duplicaterender.gsh;
14 #insert scripts\shared\shared.gsh;
15 #insert scripts\shared\version.gsh;
16 #insert scripts\shared\abilities\_ability_util.gsh;
18 #define ARMOR_MATERIAL "mc/mtl_power_armor"
19 #define ARMOR_COLOR_R .3
20 #define ARMOR_COLOR_G .3
21 #define ARMOR_COLOR_B .2
22 #define ARMOR_EXPANSION .3
37 if(
self != GetLocalPlayer( localClientNum ) )
50 function player_armor_changed( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
68 shieldExpansionNcolor =
"scriptVector3";
73 if ( GetDvarInt(
"scr_armor_dev" ) )
75 shieldExpansionValueX = GetDvarFloat(
"scr_armor_expand", shieldExpansionValueX );
76 colorVector = ( GetDvarFloat(
"scr_armor_colorR", colorVector[0] ), GetDvarFloat(
"scr_armor_colorG", colorVector[1] ), GetDvarFloat(
"scr_armor_colorB", colorVector[2] ) );
79 colorTintValueY = colorVector[0];
80 colorTintValueZ = colorVector[1];
81 colorTintValueW = colorVector[2];
83 damageState =
"scriptVector4";
86 self MapShaderConstant( localClientNum, 0, shieldExpansionNcolor, shieldExpansionValueX, colorTintValueY, colorTintValueZ, colorTintValueW );
87 self MapShaderConstant( localClientNum, 0, damageState, damageStateValue );
136 self SetDamageDirectionIndicator(1);
137 setsoundcontext(
"plr_impact",
"pwr_armor" );
141 self SetDamageDirectionIndicator(0);
142 setsoundcontext(
"plr_impact",
"" );
148 self endon(
"disconnect" );
150 if ( !isdefined(
self._gadget_armor_state ) )
155 if ( armorStatusNew ==
self._gadget_armor_state )
160 self._gadget_armor_state = armorStatusNew;
167 if (
IS_TRUE(
self._armor_doing_transition ) )
172 self._armor_doing_transition =
true;
175 flicker_start_time = GetRealTime();
176 saved_vision = GetVisionSetNaked( localClientNum );
178 visionsetnaked( localClientNum,
"taser_mine_shock", transition );
180 self playsound (0,
"wpn_taser_mine_tacmask");
184 visionSetNaked( localClientNum, saved_vision, transition );
186 self._armor_doing_transition =
false;
191 player_view = getlocalplayer( localClientNum );
193 sameEntity = (
self == player_view );