|| (!IS_VEHICLE(targ) && (IS_DEAD(targ) || IS_DEAD(this) || targ.health <= 0 || this.health <= 0))
|| (this.monster_follow == targ || targ.monster_follow == this)
|| (!IS_VEHICLE(targ) && (targ.flags & FL_NOTARGET))
- || (!autocvar_g_monsters_typefrag && targ.BUTTON_CHAT)
+ || (!autocvar_g_monsters_typefrag && PHYS_INPUT_BUTTON_CHAT(targ))
|| (SAME_TEAM(targ, this))
|| (STAT(FROZEN, targ))
|| (targ.alpha != 0 && targ.alpha < 0.5)
if(IS_PLAYER(self))
if(self.health <= autocvar_g_bloodloss && !IS_DEAD(self))
{
- self.BUTTON_CROUCH = true;
+ PHYS_INPUT_BUTTON_CROUCH(self) = true;
if(time >= self.bloodloss_timer)
{
// set pusher so self gets the kill if they fall into void
closest.pusher = self;
closest.pushltime = time + autocvar_g_maxpushtime;
- closest.istypefrag = closest.BUTTON_CHAT;
+ closest.istypefrag = PHYS_INPUT_BUTTON_CHAT(closest);
Send_Effect(EFFECT_ELECTRO_COMBO, their_org, '0 0 0', 1);
Send_Effect(EFFECT_ELECTRO_COMBO, my_org, '0 0 0', 1);
if(IS_REAL_CLIENT(self)) // bots may camp, but that's no reason to constantly kill them
if(!IS_DEAD(self))
if(!STAT(FROZEN, self))
- if(!self.BUTTON_CHAT)
+ if(!PHYS_INPUT_BUTTON_CHAT(self))
if(autocvar_g_campcheck_interval)
{
vector dist;
if (trace_startsolid)
setorigin(_nade, e.origin);
- if(self.v_angle.x >= 70 && self.v_angle.x <= 110 && self.BUTTON_CROUCH)
+ if(self.v_angle.x >= 70 && self.v_angle.x <= 110 && PHYS_INPUT_BUTTON_CROUCH(self))
_nade.velocity = '0 0 100';
else if(autocvar_g_nades_nade_newton_style == 1)
_nade.velocity = e.velocity + _velocity;
void W_HeavyMachineGun_Attack_Auto(Weapon thiswep, entity actor, .entity weaponentity, int fire)
{
- if (!actor.BUTTON_ATCK)
+ if (!PHYS_INPUT_BUTTON_ATCK(actor))
{
w_ready(thiswep, actor, weaponentity, fire);
return;
METHOD(HeavyMachineGun, wr_aim, void(entity thiswep))
{
if(vdist(self.origin - self.enemy.origin, <, 3000 - bound(0, skill, 10) * 200))
- self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, false);
+ PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(1000000, 0, 0.001, false);
else
- self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, false);
+ PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(1000000, 0, 0.001, false);
}
METHOD(HeavyMachineGun, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
{
if (wepent == WEP_Null) return; // dummy
if(ent.ok_use_ammocharge)
- if(!ent.BUTTON_ATCK) // not while attacking?
+ if(!PHYS_INPUT_BUTTON_ATCK(ent)) // not while attacking?
ent.ammo_charge[wep] = min(autocvar_g_overkill_ammo_charge_limit, ent.ammo_charge[wep] + cvar(sprintf("g_overkill_ammo_charge_rate_%s", wepent.netname)) * frametime / W_TICSPERFRAME);
}
ok_IncreaseCharge(self, PS(self).m_weapon.m_id);
- if(self.BUTTON_ATCK2)
+ if(PHYS_INPUT_BUTTON_ATCK2(self))
if(!forbidWeaponUse(self) || self.weapon_blocked) // allow if weapon is blocked
if(time >= self.jump_interval)
{
if(self.ok_use_ammocharge)
if(!ok_CheckWeaponCharge(self, PS(self).m_weapon.m_id))
{
- if(autocvar_g_overkill_ammo_charge_notice && time > self.ok_notice_time && self.BUTTON_ATCK && IS_REAL_CLIENT(self) && PS(self).m_weapon == PS(self).m_switchweapon)
+ if(autocvar_g_overkill_ammo_charge_notice && time > self.ok_notice_time && PHYS_INPUT_BUTTON_ATCK(self) && IS_REAL_CLIENT(self) && PS(self).m_weapon == PS(self).m_switchweapon)
{
//Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_OVERKILL_CHARGE);
self.ok_notice_time = time + 2;
Weapon wpn = PS(self).m_weapon;
.entity weaponentity = weaponentities[0]; // TODO: unhardcode
if(self.(weaponentity).state != WS_CLEAR)
- w_ready(wpn, self, weaponentity, (self.BUTTON_ATCK ? 1 : 0) | (self.BUTTON_ATCK2 ? 2 : 0));
+ w_ready(wpn, self, weaponentity, PHYS_INPUT_BUTTON_ATCK(self) | (PHYS_INPUT_BUTTON_ATCK2(self) << 1));
self.weapon_blocked = true;
}
- self.BUTTON_ATCK2 = 0;
+ PHYS_INPUT_BUTTON_ATCK2(self) = false;
return false;
}
METHOD(RocketPropelledChainsaw, wr_aim, void(entity thiswep))
{
- self.BUTTON_ATCK = bot_aim(WEP_CVAR(rpc, speed), 0, WEP_CVAR(rpc, lifetime), false);
+ PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR(rpc, speed), 0, WEP_CVAR(rpc, lifetime), false);
}
METHOD(RocketPropelledChainsaw, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
{
{
// slight annoyance for nick change scripts
this.movement = -1 * this.movement;
- this.BUTTON_ATCK = this.BUTTON_JUMP = this.BUTTON_ATCK2 = this.BUTTON_ZOOM = this.BUTTON_CROUCH = this.BUTTON_HOOK = this.BUTTON_USE = 0;
+ PHYS_INPUT_BUTTON_ATCK(this) = PHYS_INPUT_BUTTON_JUMP(this) = PHYS_INPUT_BUTTON_ATCK2(this) = PHYS_INPUT_BUTTON_ZOOM(this) = PHYS_INPUT_BUTTON_CROUCH(this) = PHYS_INPUT_BUTTON_HOOK(this) = PHYS_INPUT_BUTTON_USE(this) = false;
if (this.nickspamcount >= autocvar_g_nick_flood_penalty_red) // if you are persistent and the slight annoyance above does not stop you, I'll show you!
{
// add the unused velocity as up component
wishvel_z = 0;
- // if (this.BUTTON_JUMP)
+ // if (PHYS_INPUT_BUTTON_JUMP(this))
wishvel_z = sqrt(max(0, 1 - wishvel * wishvel));
// it is now normalized, so...
{
player.pusher = teleporter.owner;
player.pushltime = time + autocvar_g_maxpushtime;
- player.istypefrag = player.BUTTON_CHAT;
+ player.istypefrag = PHYS_INPUT_BUTTON_CHAT(player);
}
else
{
_out * -1, _in, autocvar_g_vehicle_bumblebee_cannon_turnspeed);
if(!forbidWeaponUse(gunner))
- if(gunner.BUTTON_ATCK)
+ if(PHYS_INPUT_BUTTON_ATCK(gunner))
if(time > gun.attack_finished_single[0])
if(gun.vehicle_energy >= autocvar_g_vehicle_bumblebee_cannon_cost)
{
UpdateAuxiliaryXhair(vehic.owner, trace_endpos, ('1 0 0' * gunner.vehicle_reload1) + ('0 1 0' *(1 - gunner.vehicle_reload1)), ((gunner == vehic.gunner1) ? 1 : 2));
vehic.solid = SOLID_BBOX;
- gunner.BUTTON_ATCK = gunner.BUTTON_ATCK2 = gunner.BUTTON_CROUCH = 0;
+ PHYS_INPUT_BUTTON_ATCK(gunner) = PHYS_INPUT_BUTTON_ATCK2(gunner) = PHYS_INPUT_BUTTON_CROUCH(gunner) = false;
gunner.vehicle_energy = (gun.vehicle_energy / autocvar_g_vehicle_bumblebee_cannon_ammo) * 100;
setself(gunner);
if(IS_DEAD(vehic))
{
setself(pilot);
- pilot.BUTTON_ATCK = pilot.BUTTON_ATCK2 = 0;
+ PHYS_INPUT_BUTTON_ATCK(pilot) = PHYS_INPUT_BUTTON_ATCK2(pilot) = false;
return 1;
}
vehic.angles_z = 0;
}
- if(pilot.BUTTON_CROUCH)
+ if(PHYS_INPUT_BUTTON_CROUCH(pilot))
newvel -= v_up * autocvar_g_vehicle_bumblebee_speed_down;
- else if(pilot.BUTTON_JUMP)
+ else if(PHYS_INPUT_BUTTON_JUMP(pilot))
newvel += v_up * autocvar_g_vehicle_bumblebee_speed_up;
vehic.velocity += newvel * frametime;
autocvar_g_vehicle_bumblebee_raygun_turnlimit_sides * -1, autocvar_g_vehicle_bumblebee_raygun_turnlimit_sides, autocvar_g_vehicle_bumblebee_raygun_turnspeed);
if(!forbidWeaponUse(pilot))
- if((pilot.BUTTON_ATCK || pilot.BUTTON_ATCK2) && (vehic.vehicle_energy > autocvar_g_vehicle_bumblebee_raygun_dps * sys_frametime || autocvar_g_vehicle_bumblebee_raygun == 0))
+ if((PHYS_INPUT_BUTTON_ATCK(pilot) || PHYS_INPUT_BUTTON_ATCK2(pilot)) && (vehic.vehicle_energy > autocvar_g_vehicle_bumblebee_raygun_dps * sys_frametime || autocvar_g_vehicle_bumblebee_raygun == 0))
{
vehic.gun3.enemy.realowner = pilot;
vehic.gun3.enemy.effects &= ~EF_NODRAW;
vehic.angles_x *= -1;
setorigin(pilot, vehic.origin + v_up * 48 + v_forward * 160);
- pilot.BUTTON_ATCK = pilot.BUTTON_ATCK2 = pilot.BUTTON_CROUCH = 0;
+ PHYS_INPUT_BUTTON_ATCK(pilot) = PHYS_INPUT_BUTTON_ATCK2(pilot) = PHYS_INPUT_BUTTON_CROUCH(pilot) = false;
setself(pilot);
return 1;
{
uforce = autocvar_g_vehicle_racer_water_upforcedamper;
- if(this.owner.BUTTON_CROUCH && time < this.air_finished)
+ if(PHYS_INPUT_BUTTON_CROUCH(this.owner) && time < this.air_finished)
this.velocity_z += 30;
else
this.velocity_z += 200;
if(IS_DEAD(racer))
{
setself(player);
- player.BUTTON_ATCK = player.BUTTON_ATCK2 = 0;
+ PHYS_INPUT_BUTTON_ATCK(player) = PHYS_INPUT_BUTTON_ATCK2(player) = false;
return 1;
}
racer_align4point(self, PHYS_INPUT_TIMELENGTH);
- player.BUTTON_ZOOM = player.BUTTON_CROUCH = 0;
+ PHYS_INPUT_BUTTON_ZOOM(player) = PHYS_INPUT_BUTTON_CROUCH(player) = false;
crosshair_trace(player);
#ifdef SVQC
Weapon wep1 = WEP_RACER;
if (!forbidWeaponUse(player))
- if (player.BUTTON_ATCK)
+ if (PHYS_INPUT_BUTTON_ATCK(player))
if (wep1.wr_checkammo1(wep1))
{
string tagname = (racer.cnt)
if(!forbidWeaponUse(player))
if(time > racer.delay)
- if(player.BUTTON_ATCK2)
+ if(PHYS_INPUT_BUTTON_ATCK2(player))
{
racer.misc_bulletcounter += 1;
racer.delay = time + 0.3;
if(racer.vehicle_flags & VHF_HASSHIELD)
VEHICLE_UPDATE_PLAYER(player, shield, racer);
- player.BUTTON_ATCK = player.BUTTON_ATCK2 = 0;
+ PHYS_INPUT_BUTTON_ATCK(player) = PHYS_INPUT_BUTTON_ATCK2(player) = false;
#endif
setorigin(player,racer.origin + '0 0 32');
if(IS_DEAD(raptor))
{
setself(player);
- player.BUTTON_ATCK = player.BUTTON_ATCK2 = 0;
+ PHYS_INPUT_BUTTON_ATCK(player) = PHYS_INPUT_BUTTON_ATCK2(player) = false;
return 1;
}
crosshair_trace(player);
//{
if(raptor.angles_z > 50 || raptor.angles_z < -50)
{
- if(player.BUTTON_JUMP)
+ if(PHYS_INPUT_BUTTON_JUMP(player))
{
- player.BUTTON_CROUCH = true;
- player.BUTTON_JUMP = false;
+ PHYS_INPUT_BUTTON_CROUCH(player) = true;
+ PHYS_INPUT_BUTTON_JUMP(player) = false;
}
}
//}
raptor.angles_z = 0;
}
- if(player.BUTTON_CROUCH)
+ if(PHYS_INPUT_BUTTON_CROUCH(player))
df -= v_up * autocvar_g_vehicle_raptor_speed_down;
- else if (player.BUTTON_JUMP)
+ else if (PHYS_INPUT_BUTTON_JUMP(player))
df += v_up * autocvar_g_vehicle_raptor_speed_up;
raptor.velocity += df * frametime;
Weapon wep1 = WEP_RAPTOR;
if(!forbidWeaponUse(player))
- if(player.BUTTON_ATCK)
+ if(PHYS_INPUT_BUTTON_ATCK(player))
if (wep1.wr_checkammo1(wep1))
{
.entity weaponentity = weaponentities[0];
if(raptor.vehicle_weapon2mode == RSM_BOMB)
{
if(time > raptor.lip + autocvar_g_vehicle_raptor_bombs_refire)
- if(player.BUTTON_ATCK2)
+ if(PHYS_INPUT_BUTTON_ATCK2(player))
{
.entity weaponentity = weaponentities[1];
wep2a.wr_think(wep2a, self, weaponentity, 2);
{
Weapon wep2b = WEP_RAPTOR_FLARE;
if(time > raptor.lip + autocvar_g_vehicle_raptor_flare_refire)
- if(player.BUTTON_ATCK2)
+ if(PHYS_INPUT_BUTTON_ATCK2(player))
{
.entity weaponentity = weaponentities[1];
wep2b.wr_think(wep2b, self, weaponentity, 2);
if(self.vehicle_flags & VHF_HASSHIELD)
VEHICLE_UPDATE_PLAYER(player, shield, raptor);
- player.BUTTON_ATCK = player.BUTTON_ATCK2 = player.BUTTON_CROUCH = 0;
+ PHYS_INPUT_BUTTON_ATCK(player) = PHYS_INPUT_BUTTON_ATCK2(player) = PHYS_INPUT_BUTTON_CROUCH(player) = false;
setself(player);
return 1;
raptor.velocity_z = min(raptor.velocity_z * 1.5, 256);
self.bomb1.gun1.avelocity_y = 90 + ((raptor.frame / 25) * 25000);
self.bomb1.gun2.avelocity_y = -self.bomb1.gun1.avelocity_y;
- player.BUTTON_ATCK = player.BUTTON_ATCK2 = player.BUTTON_CROUCH = 0;
+ PHYS_INPUT_BUTTON_ATCK(player) = PHYS_INPUT_BUTTON_ATCK2(player) = PHYS_INPUT_BUTTON_CROUCH(player) = false;
setorigin(player, raptor.origin + '0 0 32');
}
if(self.vehicle_flags & VHF_HASSHIELD)
VEHICLE_UPDATE_PLAYER(player, shield, raptor);
- player.BUTTON_ATCK = player.BUTTON_ATCK2 = player.BUTTON_CROUCH = 0;
+ PHYS_INPUT_BUTTON_ATCK(player) = PHYS_INPUT_BUTTON_ATCK2(player) = PHYS_INPUT_BUTTON_CROUCH(player) = false;
setself(player);
return 1;
}
setself(spider);
- player.BUTTON_ZOOM = 0;
- player.BUTTON_CROUCH = 0;
+ PHYS_INPUT_BUTTON_ZOOM(player) = false;
+ PHYS_INPUT_BUTTON_CROUCH(player) = false;
PS(player).m_switchweapon = WEP_Null;
player.vehicle_weapon2mode = spider.vehicle_weapon2mode;
spider.frame = 5;
}
- if(!player.BUTTON_JUMP)
- spider.BUTTON_JUMP = 0;
+ if (!PHYS_INPUT_BUTTON_JUMP(player))
+ PHYS_INPUT_BUTTON_JUMP(spider) = false;
- if((IS_ONGROUND(spider)) && player.BUTTON_JUMP && !spider.BUTTON_JUMP && self.tur_head.wait < time)
+ if((IS_ONGROUND(spider)) && PHYS_INPUT_BUTTON_JUMP(player) && !PHYS_INPUT_BUTTON_JUMP(spider) && self.tur_head.wait < time)
{
sound (self, CH_TRIGGER_SINGLE, SND_VEH_SPIDERBOT_JUMP, VOL_VEHICLEENGINE, ATTEN_NORM);
//dprint("spiderbot_jump:", ftos(soundlength("vehicles/spiderbot_jump.wav")), "\n");
self.tur_head.wait = time + 2;
spider.jump_delay = time + 2;
- spider.BUTTON_JUMP = 1; // set spider's jump
- //player.BUTTON_JUMP = 0;
+ PHYS_INPUT_BUTTON_JUMP(spider) = true; // set spider's jump
+ //PHYS_INPUT_BUTTON_JUMP(player) = false;
vector movefix = '0 0 0';
if(player.movement_x > 0) movefix_x = 1;
}
player.movement_y = 0;
float oldvelz = spider.velocity_z;
- movelib_move_simple(self, normalize(v_forward * player.movement_x),((player.BUTTON_JUMP) ? autocvar_g_vehicle_spiderbot_speed_run : autocvar_g_vehicle_spiderbot_speed_walk),autocvar_g_vehicle_spiderbot_movement_inertia);
+ movelib_move_simple(self, normalize(v_forward * player.movement_x),((PHYS_INPUT_BUTTON_JUMP(player)) ? autocvar_g_vehicle_spiderbot_speed_run : autocvar_g_vehicle_spiderbot_speed_walk),autocvar_g_vehicle_spiderbot_movement_inertia);
spider.velocity_z = oldvelz;
float g = ((autocvar_sv_gameplayfix_gravityunaffectedbyticrate) ? 0.5 : 1);
if(spider.velocity_z <= 20) // not while jumping
self.angles_z = bound(-autocvar_g_vehicle_spiderbot_tiltlimit, self.angles_z, autocvar_g_vehicle_spiderbot_tiltlimit);
if(!forbidWeaponUse(player))
- if(player.BUTTON_ATCK)
+ if(PHYS_INPUT_BUTTON_ATCK(player))
{
spider.cnt = time;
if(spider.vehicle_ammo1 >= autocvar_g_vehicle_spiderbot_minigun_ammo_cost && spider.tur_head.attack_finished_single[0] <= time)
if(self.vehicle_flags & VHF_HEALTHREGEN)
vehicles_regen(spider.dmg_time, vehicle_health, autocvar_g_vehicle_spiderbot_health, autocvar_g_vehicle_spiderbot_health_regen_pause, autocvar_g_vehicle_spiderbot_health_regen, frametime, false);
- player.BUTTON_ATCK = player.BUTTON_ATCK2 = 0;
+ PHYS_INPUT_BUTTON_ATCK(player) = PHYS_INPUT_BUTTON_ATCK2(player) = false;
//player.vehicle_ammo2 = spider.tur_head.frame;
player.vehicle_ammo2 = (9 - spider.tur_head.frame) / 8 * 100; // Percentage, like ammo1
if (self.wait != -10)
{
- if (self.owner.BUTTON_ATCK2 && self.vehicle_weapon2mode == SBRM_GUIDE)
+ if (PHYS_INPUT_BUTTON_ATCK2(self.owner) && self.vehicle_weapon2mode == SBRM_GUIDE)
{
if (self.wait == 1)
if (self.tur_head.frame == 9 || self.tur_head.frame == 1)
}
if(self.wait != -10)
- if(!self.owner.BUTTON_ATCK2)
+ if(!PHYS_INPUT_BUTTON_ATCK2(self.owner))
return;
if(forbidWeaponUse(self.owner))
rocket.nextthink = time + (_dist / autocvar_g_vehicle_spiderbot_rocket_speed);
rocket.think = vehicles_projectile_explode;
- if(self.owner.BUTTON_ATCK2 && self.tur_head.frame == 1)
+ if(PHYS_INPUT_BUTTON_ATCK2(self.owner) && self.tur_head.frame == 1)
self.wait = -10;
break;
case SBRM_GUIDE:
//if(!PHYS_INPUT_BUTTON_CROUCH(this) && !IS_DUCKED(this))
#ifdef SVQC
- //this.BUTTON_CROUCH = (old_movement_x < 0);
+ //PHYS_INPUT_BUTTON_CROUCH(this) = (old_movement_x < 0);
if (old_movement.x < 0)
- this.BUTTON_CROUCH = true;
+ PHYS_INPUT_BUTTON_CROUCH(this) = true;
#elif defined(CSQC)
if (old_movement.x < 0)
{
float burst = 0;
- if( (self.owner.BUTTON_ATCK2 && !WEP_CVAR(arc, bolt)) || self.beam_bursting)
+ if( (PHYS_INPUT_BUTTON_ATCK2(self.owner) && !WEP_CVAR(arc, bolt)) || self.beam_bursting)
{
if(!self.beam_bursting)
self.beam_bursting = true;
||
gameover
||
- (!self.owner.BUTTON_ATCK && !burst )
+ (!PHYS_INPUT_BUTTON_ATCK(self.owner) && !burst )
||
STAT(FROZEN, self.owner)
||
{
if ( random() < self.arc_heat_percent )
Send_Effect(EFFECT_ARC_SMOKE, smoke_origin, '0 0 0', 1 );
- if ( self.BUTTON_ATCK || self.BUTTON_ATCK2 )
+ if ( PHYS_INPUT_BUTTON_ATCK(self) || PHYS_INPUT_BUTTON_ATCK2(self) )
{
Send_Effect(EFFECT_ARC_OVERHEAT_FIRE, smoke_origin, w_shotdir, 1 );
if ( !self.arc_smoke_sound )
}
if ( self.arc_smoke_sound && ( self.arc_overheat <= time ||
- !( self.BUTTON_ATCK || self.BUTTON_ATCK2 ) ) || PS(self).m_switchweapon != WEP_ARC )
+ !( PHYS_INPUT_BUTTON_ATCK(self) || PHYS_INPUT_BUTTON_ATCK2(self) ) ) || PS(self).m_switchweapon != WEP_ARC )
{
self.arc_smoke_sound = 0;
sound(self, CH_SHOTS_SINGLE, SND_Null, VOL_BASE, ATTEN_NORM);
SELFPARAM();
if(WEP_CVAR(arc, beam_botaimspeed))
{
- self.BUTTON_ATCK = bot_aim(
+ PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(
WEP_CVAR(arc, beam_botaimspeed),
0,
WEP_CVAR(arc, beam_botaimlifetime),
}
else
{
- self.BUTTON_ATCK = bot_aim(
+ PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(
1000000,
0,
0.001,
if(WEP_CVAR(blaster, secondary))
{
if((random() * (WEP_CVAR_PRI(blaster, damage) + WEP_CVAR_SEC(blaster, damage))) > WEP_CVAR_PRI(blaster, damage))
- { self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_SEC(blaster, speed), 0, WEP_CVAR_SEC(blaster, lifetime), false); }
+ { PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(WEP_CVAR_SEC(blaster, speed), 0, WEP_CVAR_SEC(blaster, lifetime), false); }
else
- { self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(blaster, speed), 0, WEP_CVAR_PRI(blaster, lifetime), false); }
+ { PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR_PRI(blaster, speed), 0, WEP_CVAR_PRI(blaster, lifetime), false); }
}
else
- { self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(blaster, speed), 0, WEP_CVAR_PRI(blaster, lifetime), false); }
+ { PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR_PRI(blaster, speed), 0, WEP_CVAR_PRI(blaster, lifetime), false); }
}
METHOD(Blaster, wr_think, void(Blaster thiswep, entity actor, .entity weaponentity, int fire))
{
SELFPARAM();
if(random() < 0.10)
- self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(crylink, speed), 0, WEP_CVAR_PRI(crylink, middle_lifetime), false);
+ PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR_PRI(crylink, speed), 0, WEP_CVAR_PRI(crylink, middle_lifetime), false);
else
- self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_SEC(crylink, speed), 0, WEP_CVAR_SEC(crylink, middle_lifetime), false);
+ PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(WEP_CVAR_SEC(crylink, speed), 0, WEP_CVAR_SEC(crylink, middle_lifetime), false);
}
METHOD(Crylink, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
{
{
if(self == self.realowner.lastrocket)
if(!self.realowner.rl_release)
- if(!self.BUTTON_ATCK2)
+ if(!PHYS_INPUT_BUTTON_ATCK2(self))
if(WEP_CVAR(devastator, guiderate))
if(time > self.pushltime)
if(!IS_DEAD(self.realowner))
METHOD(Devastator, wr_aim, void(entity thiswep))
{
// aim and decide to fire if appropriate
- self.BUTTON_ATCK = bot_aim(WEP_CVAR(devastator, speed), 0, WEP_CVAR(devastator, lifetime), false);
+ PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR(devastator, speed), 0, WEP_CVAR(devastator, lifetime), false);
if(skill >= 2) // skill 0 and 1 bots won't detonate rockets!
{
// decide whether to detonate rockets
{
if(targ != missile.realowner && vlen(targ.origin - missile.origin) < WEP_CVAR(devastator, radius))
{
- self.BUTTON_ATCK2 = true;
+ PHYS_INPUT_BUTTON_ATCK2(self) = true;
break;
}
targ = targ.chain;
}
}
- if(self.BUTTON_ATCK2) self.BUTTON_ATCK = false;
+ if(PHYS_INPUT_BUTTON_ATCK2(self)) PHYS_INPUT_BUTTON_ATCK(self) = false;
}
}
#else
METHOD(Devastator, wr_aim, void(entity thiswep))
{
// aim and decide to fire if appropriate
- self.BUTTON_ATCK = bot_aim(WEP_CVAR(devastator, speed), 0, WEP_CVAR(devastator, lifetime), false);
+ PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR(devastator, speed), 0, WEP_CVAR(devastator, lifetime), false);
if(skill >= 2) // skill 0 and 1 bots won't detonate rockets!
{
// decide whether to detonate rockets
if(
(v_forward * normalize(it.origin - targ.origin)< 0.1)
&& desirabledamage > 0.1*coredamage
- )self.BUTTON_ATCK2 = true;
+ ) PHYS_INPUT_BUTTON_ATCK2(self) = true;
targ = targ.chain;
}
}
if(IS_PLAYER(self.enemy))
if(desirabledamage >= 0.1*coredamage)
if(random()/distance*300 > frametime*bound(0,(10-skill)*0.2,1))
- self.BUTTON_ATCK2 = true;
+ PHYS_INPUT_BUTTON_ATCK2(self) = true;
// dprint(ftos(random()/distance*300),">");dprint(ftos(frametime*bound(0,(10-skill)*0.2,1)),"\n");
}
});
// if we would be doing at X percent of the core damage, detonate it
// but don't fire a new shot at the same time!
if(desirabledamage >= 0.75 * coredamage) //this should do group damage in rare fortunate events
- self.BUTTON_ATCK2 = true;
+ PHYS_INPUT_BUTTON_ATCK2(self) = true;
if((skill > 6.5) && (selfdamage > self.health))
- self.BUTTON_ATCK2 = false;
- //if(self.BUTTON_ATCK2 == true)
+ PHYS_INPUT_BUTTON_ATCK2(self) = false;
+ //if(PHYS_INPUT_BUTTON_ATCK2(self) == true)
// dprint(ftos(desirabledamage),"\n");
- if(self.BUTTON_ATCK2 == true) self.BUTTON_ATCK = false;
+ if(PHYS_INPUT_BUTTON_ATCK2(self)) PHYS_INPUT_BUTTON_ATCK(self) = false;
}
}
#endif
void W_Electro_CheckAttack(Weapon thiswep, entity actor, .entity weaponentity, int fire)
{SELFPARAM();
if(self.electro_count > 1)
- if(self.BUTTON_ATCK2)
+ if(PHYS_INPUT_BUTTON_ATCK2(self))
if(weapon_prepareattack(thiswep, actor, weaponentity, true, -1))
{
W_Electro_Attack_Orb(WEP_ELECTRO);
METHOD(Electro, wr_aim, void(entity thiswep))
{
- self.BUTTON_ATCK = self.BUTTON_ATCK2 = false;
+ PHYS_INPUT_BUTTON_ATCK(self) = PHYS_INPUT_BUTTON_ATCK2(self) = false;
if(vdist(self.origin - self.enemy.origin, >, 1000)) { self.bot_secondary_electromooth = 0; }
if(self.bot_secondary_electromooth == 0)
{
if(shoot)
{
- self.BUTTON_ATCK = true;
+ PHYS_INPUT_BUTTON_ATCK(self) = true;
if(random() < 0.01) self.bot_secondary_electromooth = 1;
}
}
{
if(bot_aim(WEP_CVAR_SEC(electro, speed), WEP_CVAR_SEC(electro, speed_up), WEP_CVAR_SEC(electro, lifetime), true))
{
- self.BUTTON_ATCK2 = true;
+ PHYS_INPUT_BUTTON_ATCK2(self) = true;
if(random() < 0.03) self.bot_secondary_electromooth = 0;
}
}
METHOD(Fireball, wr_aim, void(entity thiswep))
{
- self.BUTTON_ATCK = false;
- self.BUTTON_ATCK2 = false;
+ PHYS_INPUT_BUTTON_ATCK(self) = false;
+ PHYS_INPUT_BUTTON_ATCK2(self) = false;
if(self.bot_primary_fireballmooth == 0)
{
if(bot_aim(WEP_CVAR_PRI(fireball, speed), 0, WEP_CVAR_PRI(fireball, lifetime), false))
{
- self.BUTTON_ATCK = true;
+ PHYS_INPUT_BUTTON_ATCK(self) = true;
if(random() < 0.02) self.bot_primary_fireballmooth = 0;
}
}
{
if(bot_aim(WEP_CVAR_SEC(fireball, speed), WEP_CVAR_SEC(fireball, speed_up), WEP_CVAR_SEC(fireball, lifetime), true))
{
- self.BUTTON_ATCK2 = true;
+ PHYS_INPUT_BUTTON_ATCK2(self) = true;
if(random() < 0.01) self.bot_primary_fireballmooth = 1;
}
}
bool stopped = loaded || !enough_ammo;
- if(self.BUTTON_ATCK2)
+ if(PHYS_INPUT_BUTTON_ATCK2(self))
{
- if(self.BUTTON_ATCK && WEP_CVAR_SEC(hagar, load_abort))
+ if(PHYS_INPUT_BUTTON_ATCK(self) && WEP_CVAR_SEC(hagar, load_abort))
{
if(self.hagar_load)
{
}
// release if player let go of button or if they've held it in too long
- if(!self.BUTTON_ATCK2 || (stopped && self.hagar_loadstep < time && WEP_CVAR_SEC(hagar, load_hold) >= 0))
+ if(!PHYS_INPUT_BUTTON_ATCK2(self) || (stopped && self.hagar_loadstep < time && WEP_CVAR_SEC(hagar, load_hold) >= 0))
{
self.(weaponentity).state = WS_READY;
W_Hagar_Attack2_Load_Release(weaponentity);
METHOD(Hagar, wr_aim, void(entity thiswep))
{
if(random()>0.15)
- self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(hagar, speed), 0, WEP_CVAR_PRI(hagar, lifetime), false);
+ PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR_PRI(hagar, speed), 0, WEP_CVAR_PRI(hagar, lifetime), false);
else // not using secondary_speed since these are only 15% and should cause some ricochets without re-aiming
- self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_PRI(hagar, speed), 0, WEP_CVAR_PRI(hagar, lifetime), false);
+ PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(WEP_CVAR_PRI(hagar, speed), 0, WEP_CVAR_PRI(hagar, lifetime), false);
}
METHOD(Hagar, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
{
return;
}
- if(actor.BUTTON_ATCK)
+ if(PHYS_INPUT_BUTTON_ATCK(actor))
{
if(!thiswep.wr_checkammo1(thiswep))
if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
METHOD(HLAC, wr_aim, void(entity thiswep))
{
- self.BUTTON_ATCK = bot_aim(WEP_CVAR_PRI(hlac, speed), 0, WEP_CVAR_PRI(hlac, lifetime), false);
+ PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR_PRI(hlac, speed), 0, WEP_CVAR_PRI(hlac, lifetime), false);
}
METHOD(HLAC, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
{
actor.hook_time_fueldecrease = time + WEP_CVAR_PRI(hook, hooked_time_free);
}
- actor.hook_state = BITSET(actor.hook_state, HOOK_PULLING, (!actor.BUTTON_CROUCH || !autocvar_g_balance_grapplehook_crouchslide));
+ actor.hook_state = BITSET(actor.hook_state, HOOK_PULLING, (!PHYS_INPUT_BUTTON_CROUCH(actor) || !autocvar_g_balance_grapplehook_crouchslide));
if (actor.hook_state & HOOK_FIRING)
{
w_ready(thiswep, actor, weaponentity, fire);
return;
}
- if(actor.BUTTON_ATCK)
+ if(PHYS_INPUT_BUTTON_ATCK(actor))
{
if(!thiswep.wr_checkammo2(thiswep))
if(!(actor.items & IT_UNLIMITED_WEAPON_AMMO))
METHOD(MachineGun, wr_aim, void(entity thiswep))
{
if(vdist(self.origin - self.enemy.origin, <, 3000 - bound(0, skill, 10) * 200))
- self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, false);
+ PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(1000000, 0, 0.001, false);
else
- self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, false);
+ PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(1000000, 0, 0.001, false);
}
METHOD(MachineGun, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
{
{
// aim and decide to fire if appropriate
if(self.minelayer_mines >= WEP_CVAR(minelayer, limit))
- self.BUTTON_ATCK = false;
+ PHYS_INPUT_BUTTON_ATCK(self) = false;
else
- self.BUTTON_ATCK = bot_aim(WEP_CVAR(minelayer, speed), 0, WEP_CVAR(minelayer, lifetime), false);
+ PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR(minelayer, speed), 0, WEP_CVAR(minelayer, lifetime), false);
if(skill >= 2) // skill 0 and 1 bots won't detonate mines!
{
// decide whether to detonate mines
if(
(v_forward * normalize(mine.origin - targ.origin)< 0.1)
&& desirabledamage > 0.1*coredamage
- )self.BUTTON_ATCK2 = true;
+ ) PHYS_INPUT_BUTTON_ATCK2(self) = true;
targ = targ.chain;
}
}else{
if(IS_PLAYER(self.enemy))
if(desirabledamage >= 0.1*coredamage)
if(random()/distance*300 > frametime*bound(0,(10-skill)*0.2,1))
- self.BUTTON_ATCK2 = true;
+ PHYS_INPUT_BUTTON_ATCK2(self) = true;
// dprint(ftos(random()/distance*300),">");dprint(ftos(frametime*bound(0,(10-skill)*0.2,1)),"\n");
}
// if we would be doing at X percent of the core damage, detonate it
// but don't fire a new shot at the same time!
if(desirabledamage >= 0.75 * coredamage) //this should do group damage in rare fortunate events
- self.BUTTON_ATCK2 = true;
+ PHYS_INPUT_BUTTON_ATCK2(self) = true;
if((skill > 6.5) && (selfdamage > self.health))
- self.BUTTON_ATCK2 = false;
- //if(self.BUTTON_ATCK2 == true)
+ PHYS_INPUT_BUTTON_ATCK2(self) = false;
+ //if(PHYS_INPUT_BUTTON_ATCK2(self) == true)
// dprint(ftos(desirabledamage),"\n");
- if(self.BUTTON_ATCK2 == true) self.BUTTON_ATCK = false;
+ if(PHYS_INPUT_BUTTON_ATCK2(self)) PHYS_INPUT_BUTTON_ATCK(self) = false;
}
}
METHOD(MineLayer, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
METHOD(Mortar, wr_aim, void(entity thiswep))
{
- self.BUTTON_ATCK = false;
- self.BUTTON_ATCK2 = false;
+ PHYS_INPUT_BUTTON_ATCK(self) = false;
+ PHYS_INPUT_BUTTON_ATCK2(self) = false;
if(self.bot_secondary_grenademooth == 0) // WEAPONTODO: merge this into using WEP_CVAR_BOTH
{
if(bot_aim(WEP_CVAR_PRI(mortar, speed), WEP_CVAR_PRI(mortar, speed_up), WEP_CVAR_PRI(mortar, lifetime), true))
{
- self.BUTTON_ATCK = true;
+ PHYS_INPUT_BUTTON_ATCK(self) = true;
if(random() < 0.01) self.bot_secondary_grenademooth = 1;
}
}
{
if(bot_aim(WEP_CVAR_SEC(mortar, speed), WEP_CVAR_SEC(mortar, speed_up), WEP_CVAR_SEC(mortar, lifetime), true))
{
- self.BUTTON_ATCK2 = true;
+ PHYS_INPUT_BUTTON_ATCK2(self) = true;
if(random() < 0.02) self.bot_secondary_grenademooth = 0;
}
}
METHOD(PortoLaunch, wr_aim, void(entity thiswep))
{
SELFPARAM();
- self.BUTTON_ATCK = false;
- self.BUTTON_ATCK2 = false;
+ PHYS_INPUT_BUTTON_ATCK(self) = false;
+ PHYS_INPUT_BUTTON_ATCK2(self) = false;
if(!WEP_CVAR(porto, secondary))
if(bot_aim(WEP_CVAR_PRI(porto, speed), 0, WEP_CVAR_PRI(porto, lifetime), false))
- self.BUTTON_ATCK = true;
+ PHYS_INPUT_BUTTON_ATCK(self) = true;
}
METHOD(PortoLaunch, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
{
Send_Effect(EFFECT_RIFLE_MUZZLEFLASH, w_shotorg, w_shotdir * 2000, 1);
- if(self.BUTTON_ZOOM | self.BUTTON_ZOOMSCRIPT) // if zoomed, shoot from the eye
+ if(PHYS_INPUT_BUTTON_ZOOM(self) | PHYS_INPUT_BUTTON_ZOOMSCRIPT(self)) // if zoomed, shoot from the eye
{
w_shotdir = v_forward;
w_shotorg = self.origin + self.view_ofs + ((w_shotorg - self.origin - self.view_ofs) * v_forward) * v_forward;
METHOD(Rifle, wr_aim, void(entity thiswep))
{
- self.BUTTON_ATCK=false;
- self.BUTTON_ATCK2=false;
+ PHYS_INPUT_BUTTON_ATCK(self) = false;
+ PHYS_INPUT_BUTTON_ATCK2(self) = false;
if(vdist(self.origin - self.enemy.origin, >, 1000))
self.bot_secondary_riflemooth = 0;
if(self.bot_secondary_riflemooth == 0)
{
if(bot_aim(1000000, 0, 0.001, false))
{
- self.BUTTON_ATCK = true;
+ PHYS_INPUT_BUTTON_ATCK(self) = true;
if(random() < 0.01) self.bot_secondary_riflemooth = 1;
}
}
{
if(bot_aim(1000000, 0, 0.001, false))
{
- self.BUTTON_ATCK2 = true;
+ PHYS_INPUT_BUTTON_ATCK2(self) = true;
if(random() < 0.03) self.bot_secondary_riflemooth = 0;
}
}
{
if(WEP_CVAR(seeker, type) == 1)
if(W_Seeker_Tagged_Info(self, self.enemy) != world)
- self.BUTTON_ATCK = bot_aim(WEP_CVAR(seeker, missile_speed_max), 0, WEP_CVAR(seeker, missile_lifetime), false);
+ PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR(seeker, missile_speed_max), 0, WEP_CVAR(seeker, missile_lifetime), false);
else
- self.BUTTON_ATCK2 = bot_aim(WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), false);
+ PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), false);
else
- self.BUTTON_ATCK = bot_aim(WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), false);
+ PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(WEP_CVAR(seeker, tag_speed), 0, WEP_CVAR(seeker, tag_lifetime), false);
}
METHOD(Seeker, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
{
METHOD(Shockwave, wr_aim, void(entity thiswep))
{
if(vlen(self.origin - self.enemy.origin) <= WEP_CVAR(shockwave, melee_range))
- { self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, false); }
+ { PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(1000000, 0, 0.001, false); }
else
- { self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, false); }
+ { PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(1000000, 0, 0.001, false); }
}
METHOD(Shockwave, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
{
METHOD(Shotgun, wr_aim, void(entity thiswep))
{
if(vdist(self.origin - self.enemy.origin, <=, WEP_CVAR_SEC(shotgun, melee_range)))
- self.BUTTON_ATCK2 = bot_aim(1000000, 0, 0.001, false);
+ PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(1000000, 0, 0.001, false);
else
- self.BUTTON_ATCK = bot_aim(1000000, 0, 0.001, false);
+ PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(1000000, 0, 0.001, false);
}
METHOD(Shotgun, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
{
case 8: note = +4; break; // e
case 9: note = -1; break; // B
}
- if(pl.BUTTON_CROUCH)
+ if(PHYS_INPUT_BUTTON_CROUCH(pl))
note -= 12;
- if(pl.BUTTON_JUMP)
+ if(PHYS_INPUT_BUTTON_JUMP(pl))
note += 12;
if(hittype & HITTYPE_SECONDARY)
note += 7;
if (vdist((actor.origin - actor.enemy.origin), <, WEP_CVAR(tuba, radius)))
{
if (random() > 0.5)
- actor.BUTTON_ATCK = 1;
+ PHYS_INPUT_BUTTON_ATCK(actor) = true;
else
- actor.BUTTON_ATCK2 = 1;
+ PHYS_INPUT_BUTTON_ATCK2(actor) = true;
}
}
METHOD(Vaporizer, wr_aim, void(entity thiswep))
{
if(self.(thiswep.ammo_field) > 0)
- self.BUTTON_ATCK = bot_aim(1000000, 0, 1, false);
+ PHYS_INPUT_BUTTON_ATCK(self) = bot_aim(1000000, 0, 1, false);
else
- self.BUTTON_ATCK2 = bot_aim(WEP_CVAR_SEC(vaporizer, speed), 0, WEP_CVAR_SEC(vaporizer, lifetime), false); // WEAPONTODO: replace with proper vaporizer cvars
+ PHYS_INPUT_BUTTON_ATCK2(self) = bot_aim(WEP_CVAR_SEC(vaporizer, speed), 0, WEP_CVAR_SEC(vaporizer, lifetime), false); // WEAPONTODO: replace with proper vaporizer cvars
}
METHOD(Vaporizer, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
{
METHOD(Vortex, wr_aim, void(entity thiswep))
{
if(bot_aim(1000000, 0, 1, false))
- self.BUTTON_ATCK = true;
+ PHYS_INPUT_BUTTON_ATCK(self) = true;
else
{
if(WEP_CVAR(vortex, charge))
- self.BUTTON_ATCK2 = true;
+ PHYS_INPUT_BUTTON_ATCK2(self) = true;
}
}
METHOD(Vortex, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire))
weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(vortex, animtime), w_ready);
}
}
- if((WEP_CVAR(vortex, charge) && !WEP_CVAR(vortex, secondary)) ? (actor.BUTTON_ZOOM | actor.BUTTON_ZOOMSCRIPT) : (fire & 2))
+ if((WEP_CVAR(vortex, charge) && !WEP_CVAR(vortex, secondary)) ? (PHYS_INPUT_BUTTON_ZOOM(actor) | PHYS_INPUT_BUTTON_ZOOMSCRIPT(actor)) : (fire & 2))
{
if(WEP_CVAR(vortex, charge))
{
return false;
if (IS_DEAD(e))
return false;
- if (e.BUTTON_CHAT)
+ if (PHYS_INPUT_BUTTON_CHAT(e))
return false;
if(e.flags & FL_NOTARGET)
return false;
// skill 0 = ping 0.7 (slightly drunk)
// clear buttons
- self.BUTTON_ATCK = 0;
- self.button1 = 0;
- self.BUTTON_JUMP = 0;
- self.BUTTON_ATCK2 = 0;
- self.BUTTON_ZOOM = 0;
- self.BUTTON_CROUCH = 0;
- self.BUTTON_HOOK = 0;
- self.BUTTON_INFO = 0;
- self.button8 = 0;
- self.BUTTON_CHAT = 0;
- self.BUTTON_USE = 0;
+ PHYS_INPUT_BUTTON_ATCK(self) = false;
+ PHYS_INPUT_BUTTON_JUMP(self) = false;
+ PHYS_INPUT_BUTTON_ATCK2(self) = false;
+ PHYS_INPUT_BUTTON_ZOOM(self) = false;
+ PHYS_INPUT_BUTTON_CROUCH(self) = false;
+ PHYS_INPUT_BUTTON_HOOK(self) = false;
+ PHYS_INPUT_BUTTON_INFO(self) = false;
+ PHYS_INPUT_BUTTON_DRAG(self) = false;
+ PHYS_INPUT_BUTTON_CHAT(self) = false;
+ PHYS_INPUT_BUTTON_USE(self) = false;
if (time < game_starttime)
{
{
if (self.deadflag == DEAD_DEAD)
{
- self.BUTTON_JUMP = 1; // press jump to respawn
+ PHYS_INPUT_BUTTON_JUMP(self) = true; // press jump to respawn
self.bot_strategytime = 0;
}
}
w.wr_aim(w);
if (autocvar_bot_nofire || IS_INDEPENDENT_PLAYER(self))
{
- self.BUTTON_ATCK = false;
- self.BUTTON_ATCK2 = false;
+ PHYS_INPUT_BUTTON_ATCK(self) = false;
+ PHYS_INPUT_BUTTON_ATCK2(self) = false;
}
else
{
- if(self.BUTTON_ATCK||self.BUTTON_ATCK2)
+ if(PHYS_INPUT_BUTTON_ATCK(self) || PHYS_INPUT_BUTTON_ATCK2(self))
self.lastfiredweapon = PS(self).m_weapon.m_id;
}
}
keyboard.z = 0;
self.havocbot_keyboard = keyboard * maxspeed;
- if (self.havocbot_ducktime>time) self.BUTTON_CROUCH=true;
+ if (self.havocbot_ducktime>time) PHYS_INPUT_BUTTON_CROUCH(self) = true;
keyboard = self.havocbot_keyboard;
blend = bound(0,vlen(destorg-self.origin)/autocvar_bot_ai_keyboard_distance,1); // When getting close move with 360 degree
if(self.aistatus & AI_STATUS_DANGER_AHEAD)
{
self.aistatus &= ~AI_STATUS_RUNNING;
- self.BUTTON_JUMP = false;
+ PHYS_INPUT_BUTTON_JUMP(self) = false;
self.bot_canruntogoal = 0;
self.bot_timelastseengoal = 0;
return;
{
self.aistatus &= ~AI_STATUS_RUNNING;
if(bunnyhopdistance > autocvar_bot_ai_bunnyhop_stopdistance)
- self.BUTTON_JUMP = true;
+ PHYS_INPUT_BUTTON_JUMP(self) = true;
}
else
{
self.aistatus |= AI_STATUS_RUNNING;
- self.BUTTON_JUMP = true;
+ PHYS_INPUT_BUTTON_JUMP(self) = true;
}
}
}
if((IS_ONGROUND(self)) == 0)
{
if(self.velocity.z < 0 || vlen(self.velocity)<maxspeed)
- self.BUTTON_JUMP = false;
+ PHYS_INPUT_BUTTON_JUMP(self) = false;
// Strafe
if(self.aistatus & AI_STATUS_RUNNING)
}
// Flying
- self.BUTTON_HOOK = true;
+ PHYS_INPUT_BUTTON_HOOK(self) = true;
if(self.navigation_jetpack_point.z - STAT(PL_MAX, NULL).z + STAT(PL_MIN, NULL).z < self.origin.z)
{
self.movement_x = dir * v_forward * maxspeed;
{
if(self.velocity.z<0)
{
- self.BUTTON_HOOK = true;
+ PHYS_INPUT_BUTTON_HOOK(self) = true;
}
}
else
- self.BUTTON_HOOK = true;
+ PHYS_INPUT_BUTTON_HOOK(self) = true;
// If there is no goal try to move forward
{
if(time > self.rocketjumptime)
{
- self.BUTTON_ATCK2 = true;
+ PHYS_INPUT_BUTTON_ATCK2(self) = true;
self.rocketjumptime = 0;
}
return;
PS(self).m_switchweapon = WEP_DEVASTATOR;
self.v_angle_x = 90;
- self.BUTTON_ATCK = true;
+ PHYS_INPUT_BUTTON_ATCK(self) = true;
self.rocketjumptime = time + WEP_CVAR(devastator, detonatedelay);
return;
}
if(self.waterlevel>WATERLEVEL_SWIMMING)
dir.z = 1;
else if(self.velocity.z >= 0 && !(self.waterlevel == WATERLEVEL_WETFEET && self.watertype == CONTENT_WATER))
- self.BUTTON_JUMP = true;
+ PHYS_INPUT_BUTTON_JUMP(self) = true;
else
- self.BUTTON_JUMP = false;
+ PHYS_INPUT_BUTTON_JUMP(self) = false;
makevectors(self.v_angle.y * '0 1 0');
self.movement_x = dir * v_forward * maxspeed;
self.movement_y = dir * v_right * maxspeed;
{
if(self.velocity.z >= 0 && !(self.watertype == CONTENT_WATER && gco.z < self.origin.z) &&
( !(self.waterlevel == WATERLEVEL_WETFEET && self.watertype == CONTENT_WATER) || self.aistatus & AI_STATUS_OUT_WATER))
- self.BUTTON_JUMP = true;
+ PHYS_INPUT_BUTTON_JUMP(self) = true;
else
- self.BUTTON_JUMP = false;
+ PHYS_INPUT_BUTTON_JUMP(self) = false;
}
dir = normalize(flatdir);
makevectors(self.v_angle.y * '0 1 0');
s = trace_fraction;
tracebox(self.origin + jumpstepheightvec, self.mins, self.maxs, self.origin + self.velocity * 0.2 + jumpstepheightvec, false, self);
if (trace_fraction > s)
- self.BUTTON_JUMP = 1;
+ PHYS_INPUT_BUTTON_JUMP(self) = true;
}
}
// Check head-banging against walls
if(vlen(self.origin + self.view_ofs - trace_endpos) < 25 && !(self.aistatus & AI_STATUS_OUT_WATER))
{
- self.BUTTON_JUMP = true;
+ PHYS_INPUT_BUTTON_JUMP(self) = true;
if(self.facingwalltime && time > self.facingwalltime)
{
self.ignoregoal = self.goalcurrent;
self.aistatus &= ~AI_STATUS_DANGER_AHEAD;
if(trace_fraction == 1 && self.jumppadcount == 0 && !self.goalcurrent.wphardwired )
- if((IS_ONGROUND(self)) || (self.aistatus & AI_STATUS_RUNNING) || self.BUTTON_JUMP == true)
+ if((IS_ONGROUND(self)) || (self.aistatus & AI_STATUS_RUNNING) || PHYS_INPUT_BUTTON_JUMP(self))
{
// Look downwards
traceline(dst_ahead , dst_down, true, world);
dir = normalize(dir + dodge + evadeobstacle + evadelava);
// self.bot_dodgevector = dir;
- // self.bot_dodgevector_jumpbutton = self.BUTTON_JUMP;
+ // self.bot_dodgevector_jumpbutton = PHYS_INPUT_BUTTON_JUMP(self);
}
if(time < self.ladder_time)
//dir = self.bot_dodgevector;
//if (self.bot_dodgevector_jumpbutton)
- // self.BUTTON_JUMP = 1;
+ // PHYS_INPUT_BUTTON_JUMP(self) = true;
self.movement_x = dir * v_forward * maxspeed;
self.movement_y = dir * v_right * maxspeed;
self.movement_z = dir * v_up * maxspeed;
if(skill+self.bot_moveskill >= autocvar_bot_ai_bunnyhop_skilloffset)
havocbot_bunnyhop(dir);
- if ((dir * v_up) >= autocvar_sv_jumpvelocity*0.5 && (IS_ONGROUND(self))) self.BUTTON_JUMP=1;
- if (((dodge * v_up) > 0) && random()*frametime >= 0.2*bound(0,(10-skill-self.bot_dodgeskill)*0.1,1)) self.BUTTON_JUMP=true;
+ if ((dir * v_up) >= autocvar_sv_jumpvelocity*0.5 && (IS_ONGROUND(self))) PHYS_INPUT_BUTTON_JUMP(self) = true;
+ if (((dodge * v_up) > 0) && random()*frametime >= 0.2*bound(0,(10-skill-self.bot_dodgeskill)*0.1,1)) PHYS_INPUT_BUTTON_JUMP(self) = true;
if (((dodge * v_up) < 0) && random()*frametime >= 0.5*bound(0,(10-skill-self.bot_dodgeskill)*0.1,1)) self.havocbot_ducktime=time+0.3/bound(0.1,skill+self.bot_dodgeskill,10);
}
float bot_presskeys()
{SELFPARAM();
self.movement = '0 0 0';
- self.BUTTON_JUMP = false;
- self.BUTTON_CROUCH = false;
- self.BUTTON_ATCK = false;
- self.BUTTON_ATCK2 = false;
- self.BUTTON_USE = false;
- self.BUTTON_HOOK = false;
- self.BUTTON_CHAT = false;
+ PHYS_INPUT_BUTTON_JUMP(self) = false;
+ PHYS_INPUT_BUTTON_CROUCH(self) = false;
+ PHYS_INPUT_BUTTON_ATCK(self) = false;
+ PHYS_INPUT_BUTTON_ATCK2(self) = false;
+ PHYS_INPUT_BUTTON_USE(self) = false;
+ PHYS_INPUT_BUTTON_HOOK(self) = false;
+ PHYS_INPUT_BUTTON_CHAT(self) = false;
if(self.bot_cmd_keys == BOT_CMD_KEY_NONE)
return false;
self.movement_y = -autocvar_sv_maxspeed;
if(self.bot_cmd_keys & BOT_CMD_KEY_JUMP)
- self.BUTTON_JUMP = true;
+ PHYS_INPUT_BUTTON_JUMP(self) = true;
if(self.bot_cmd_keys & BOT_CMD_KEY_CROUCH)
- self.BUTTON_CROUCH = true;
+ PHYS_INPUT_BUTTON_CROUCH(self) = true;
if(self.bot_cmd_keys & BOT_CMD_KEY_ATTACK1)
- self.BUTTON_ATCK = true;
+ PHYS_INPUT_BUTTON_ATCK(self) = true;
if(self.bot_cmd_keys & BOT_CMD_KEY_ATTACK2)
- self.BUTTON_ATCK2 = true;
+ PHYS_INPUT_BUTTON_ATCK2(self) = true;
if(self.bot_cmd_keys & BOT_CMD_KEY_USE)
- self.BUTTON_USE = true;
+ PHYS_INPUT_BUTTON_USE(self) = true;
if(self.bot_cmd_keys & BOT_CMD_KEY_HOOK)
- self.BUTTON_HOOK = true;
+ PHYS_INPUT_BUTTON_HOOK(self) = true;
if(self.bot_cmd_keys & BOT_CMD_KEY_CHAT)
- self.BUTTON_CHAT = true;
+ PHYS_INPUT_BUTTON_CHAT(self) = true;
return true;
}
float bot_cmd_pause()
{SELFPARAM();
- self.button1 = 0;
- self.button8 = 0;
- self.BUTTON_USE = 0;
- self.BUTTON_ATCK = 0;
- self.BUTTON_JUMP = 0;
- self.BUTTON_HOOK = 0;
- self.BUTTON_CHAT = 0;
- self.BUTTON_ATCK2 = 0;
- self.BUTTON_CROUCH = 0;
+ PHYS_INPUT_BUTTON_DRAG(self) = false;
+ PHYS_INPUT_BUTTON_USE(self) = false;
+ PHYS_INPUT_BUTTON_ATCK(self) = false;
+ PHYS_INPUT_BUTTON_JUMP(self) = false;
+ PHYS_INPUT_BUTTON_HOOK(self) = false;
+ PHYS_INPUT_BUTTON_CHAT(self) = false;
+ PHYS_INPUT_BUTTON_ATCK2(self) = false;
+ PHYS_INPUT_BUTTON_CROUCH(self) = false;
self.movement = '0 0 0';
self.bot_cmd_keys = BOT_CMD_KEY_NONE;
#include "../common/deathtypes/all.qh"
#include "../common/util.qh"
+#include <common/physics/player.qh>
+
#include "../common/monsters/all.qh"
#include "../common/weapons/all.qh"
default:
if(Drag_IsDragging(self))
{
- if(self.BUTTON_DRAG)
+ if(PHYS_INPUT_BUTTON_DRAG(self))
{
if(self.impulse == 10 || self.impulse == 15 || self.impulse == 18)
{
else
{
if(Drag_CanDrag(self))
- if(self.BUTTON_DRAG)
+ if(PHYS_INPUT_BUTTON_DRAG(self))
{
crosshair_trace_plusvisibletriggers(self);
entity e = trace_ent;
this.bot_attack = true;
this.monster_attack = true;
- this.BUTTON_ATCK = this.BUTTON_JUMP = this.BUTTON_ATCK2 = false;
+ PHYS_INPUT_BUTTON_ATCK(this) = PHYS_INPUT_BUTTON_JUMP(this) = PHYS_INPUT_BUTTON_ATCK2(this) = false;
if (this.killcount == FRAGS_SPECTATOR) {
PlayerScore_Clear(this);
GetCvars(-1);
}
-.float BUTTON_CHAT;
void ChatBubbleThink()
{SELFPARAM();
self.nextthink = time;
{
if ( self.owner.active_minigame )
self.mdl = "models/sprites/minigame_busy.iqm";
- else if ( self.owner.BUTTON_CHAT )
+ else if (PHYS_INPUT_BUTTON_CHAT(self.owner))
self.mdl = "models/misc/chatbubble.spr";
}
self.angles = spectatee.v_angle;
STAT(FROZEN, self) = STAT(FROZEN, spectatee);
self.revive_progress = spectatee.revive_progress;
- if(!self.BUTTON_USE)
+ if(!PHYS_INPUT_BUTTON_USE(self))
self.fixangle = true;
setorigin(self, spectatee.origin);
setsize(self, spectatee.mins, spectatee.maxs);
if(self.motd_actived_time == 0)
{
if (autocvar_g_campaign) {
- if ((IS_PLAYER(self) && self.BUTTON_INFO) || (!IS_PLAYER(self))) {
+ if ((IS_PLAYER(self) && PHYS_INPUT_BUTTON_INFO(self)) || (!IS_PLAYER(self))) {
self.motd_actived_time = time;
Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_MOTD, campaign_message);
}
} else {
- if (self.BUTTON_INFO) {
+ if (PHYS_INPUT_BUTTON_INFO(self)) {
self.motd_actived_time = time;
Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_MOTD, getwelcomemessage());
}
else if(self.motd_actived_time > 0) // showing MOTD or campaign message
{
if (autocvar_g_campaign) {
- if (self.BUTTON_INFO)
+ if (PHYS_INPUT_BUTTON_INFO(self))
self.motd_actived_time = time;
else if ((time - self.motd_actived_time > 2) && IS_PLAYER(self)) { // hide it some seconds after BUTTON_INFO has been released
self.motd_actived_time = 0;
Kill_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER_CPID, CPID_MOTD);
}
} else {
- if (self.BUTTON_INFO)
+ if (PHYS_INPUT_BUTTON_INFO(self))
self.motd_actived_time = time;
else if (time - self.motd_actived_time > 2) { // hide it some seconds after BUTTON_INFO has been released
self.motd_actived_time = 0;
}
else //if(self.motd_actived_time < 0) // just connected, motd is active
{
- if(self.BUTTON_INFO) // BUTTON_INFO hides initial MOTD
+ if(PHYS_INPUT_BUTTON_INFO(self)) // BUTTON_INFO hides initial MOTD
self.motd_actived_time = -2; // wait until BUTTON_INFO gets released
else if(self.motd_actived_time == -2 || IS_PLAYER(self) || IS_SPEC(self))
{
}
float prefered_movetype;
if (self.flags & FL_JUMPRELEASED) {
- if (self.BUTTON_JUMP && !self.version_mismatch) {
+ if (PHYS_INPUT_BUTTON_JUMP(self) && !self.version_mismatch) {
self.flags &= ~FL_JUMPRELEASED;
self.flags |= FL_SPAWNING;
- } else if(self.BUTTON_ATCK && !self.version_mismatch) {
+ } else if(PHYS_INPUT_BUTTON_ATCK(self) && !self.version_mismatch) {
self.flags &= ~FL_JUMPRELEASED;
if(SpectateNext()) {
self.classname = STR_SPECTATOR;
}
} else {
- prefered_movetype = ((!self.BUTTON_USE ? self.cvar_cl_clippedspectating : !self.cvar_cl_clippedspectating) ? MOVETYPE_FLY_WORLDONLY : MOVETYPE_NOCLIP);
+ prefered_movetype = ((!PHYS_INPUT_BUTTON_USE(self) ? self.cvar_cl_clippedspectating : !self.cvar_cl_clippedspectating) ? MOVETYPE_FLY_WORLDONLY : MOVETYPE_NOCLIP);
if (self.movetype != prefered_movetype)
self.movetype = prefered_movetype;
}
} else {
- if (!(self.BUTTON_ATCK || self.BUTTON_JUMP)) {
+ if (!(PHYS_INPUT_BUTTON_ATCK(self) || PHYS_INPUT_BUTTON_JUMP(self))) {
self.flags |= FL_JUMPRELEASED;
if(self.flags & FL_SPAWNING)
{
self.impulse = 0;
}
if (self.flags & FL_JUMPRELEASED) {
- if (self.BUTTON_JUMP && !self.version_mismatch) {
+ if (PHYS_INPUT_BUTTON_JUMP(self) && !self.version_mismatch) {
self.flags &= ~FL_JUMPRELEASED;
self.flags |= FL_SPAWNING;
- } else if(self.BUTTON_ATCK || self.impulse == 10 || self.impulse == 15 || self.impulse == 18 || (self.impulse >= 200 && self.impulse <= 209)) {
+ } else if(PHYS_INPUT_BUTTON_ATCK(self) || self.impulse == 10 || self.impulse == 15 || self.impulse == 18 || (self.impulse >= 200 && self.impulse <= 209)) {
self.flags &= ~FL_JUMPRELEASED;
if(SpectateNext()) {
self.classname = STR_SPECTATOR;
PutClientInServer();
}
self.impulse = 0;
- } else if (self.BUTTON_ATCK2) {
+ } else if (PHYS_INPUT_BUTTON_ATCK2(self)) {
self.flags &= ~FL_JUMPRELEASED;
self.classname = STR_OBSERVER;
PutClientInServer();
PutObserverInServer();
}
} else {
- if (!(self.BUTTON_ATCK || self.BUTTON_ATCK2)) {
+ if (!(PHYS_INPUT_BUTTON_ATCK(self) || PHYS_INPUT_BUTTON_ATCK2(self))) {
self.flags |= FL_JUMPRELEASED;
if(self.flags & FL_SPAWNING)
{
if(!self.cvar_cl_newusekeysupported) // FIXME remove this - it was a stupid idea to begin with, we can JUST use the button
{
- if(self.BUTTON_USE && !self.usekeypressed)
+ if(PHYS_INPUT_BUTTON_USE(self) && !self.usekeypressed)
PlayerUseKey();
- self.usekeypressed = self.BUTTON_USE;
+ self.usekeypressed = PHYS_INPUT_BUTTON_USE(self);
}
if(IS_REAL_CLIENT(self))
float button_pressed;
if(frametime)
player_anim();
- button_pressed = (self.BUTTON_ATCK || self.BUTTON_JUMP || self.BUTTON_ATCK2 || self.BUTTON_HOOK || self.BUTTON_USE);
+ button_pressed = (PHYS_INPUT_BUTTON_ATCK(self) || PHYS_INPUT_BUTTON_JUMP(self) || PHYS_INPUT_BUTTON_ATCK2(self) || PHYS_INPUT_BUTTON_HOOK(self) || PHYS_INPUT_BUTTON_USE(self));
if (self.deadflag == DEAD_DYING)
{
self.prevorigin = self.origin;
- float do_crouch = self.BUTTON_CROUCH;
+ float do_crouch = PHYS_INPUT_BUTTON_CROUCH(self);
if(self.hook.state)
do_crouch = 0;
if(self.vehicle)
// WEAPONTODO: Add weapon request for this
if(!zoomstate_set)
SetZoomState(
- self.BUTTON_ZOOM
- || self.BUTTON_ZOOMSCRIPT
- || (self.BUTTON_ATCK2 && PS(self).m_weapon == WEP_VORTEX)
- || (self.BUTTON_ATCK2 && PS(self).m_weapon == WEP_RIFLE && WEP_CVAR(rifle, secondary) == 0)
+ PHYS_INPUT_BUTTON_ZOOM(self)
+ || PHYS_INPUT_BUTTON_ZOOMSCRIPT(self)
+ || (PHYS_INPUT_BUTTON_ATCK2(self) && PS(self).m_weapon == WEP_VORTEX)
+ || (PHYS_INPUT_BUTTON_ATCK2(self) && PS(self).m_weapon == WEP_RIFLE && WEP_CVAR(rifle, secondary) == 0)
); // WEAPONTODO
float oldspectatee_status;
{
this.pusher = attacker;
this.pushltime = time + autocvar_g_maxpushtime;
- this.istypefrag = this.BUTTON_CHAT;
+ this.istypefrag = PHYS_INPUT_BUTTON_CHAT(this);
}
else if(time < this.pushltime)
{
#define INDEPENDENT_ATTACK_FINISHED 1
-// TODO: deprecated: remove. Replaced by physics.qh PHYS_INPUT_BUTTON_*
-
-#define BUTTON_ATCK button0
-#define BUTTON_JUMP button2
-#define BUTTON_ATCK2 button3
-#define BUTTON_ZOOM button4
-#define BUTTON_CROUCH button5
-#define BUTTON_HOOK button6
-#define BUTTON_INFO button7
-#define BUTTON_DRAG button8
-#define BUTTON_USE buttonuse
-#define BUTTON_CHAT buttonchat
-#define BUTTON_PRYDON cursor_active
-#define BUTTON_ZOOMSCRIPT button9
-#define BUTTON_JETPACK button10
-
// Globals
float g_footsteps, g_grappling_hook, g_instagib;
s = strcat(s, "I");
if(player.flagcarried != world)
s = strcat(s, "F");
- if(player.BUTTON_CHAT)
+ if(PHYS_INPUT_BUTTON_CHAT(player))
s = strcat(s, "T");
if(player.kh_next)
s = strcat(s, "K");
{
if(deathtype != DEATH_FIRE.m_id)
{
- if(victim.BUTTON_CHAT)
+ if(PHYS_INPUT_BUTTON_CHAT(victim))
attacker.typehitsound += 1;
else
attacker.damage_dealt += damage;
self.aiment.nextthink = time + autocvar_g_balance_grapplehook_nade_time; // set time after letting go?
aim_ent.pusher = self.realowner;
aim_ent.pushltime = time + autocvar_g_maxpushtime;
- aim_ent.istypefrag = aim_ent.BUTTON_CHAT;
+ aim_ent.istypefrag = PHYS_INPUT_BUTTON_CHAT(aim_ent);
}
}
{
this.realowner.pusher = attacker;
this.realowner.pushltime = time + autocvar_g_maxpushtime;
- this.realowner.istypefrag = this.realowner.BUTTON_CHAT;
+ this.realowner.istypefrag = PHYS_INPUT_BUTTON_CHAT(this.realowner);
}
RemoveGrapplingHook(this.realowner);
}
return;
if(!mapvote_initialized)
- if (time < intermission_exittime + 10 && !(self.BUTTON_ATCK || self.BUTTON_JUMP || self.BUTTON_ATCK2 || self.BUTTON_HOOK || self.BUTTON_USE))
+ if (time < intermission_exittime + 10 && !(PHYS_INPUT_BUTTON_ATCK(self) || PHYS_INPUT_BUTTON_JUMP(self) || PHYS_INPUT_BUTTON_ATCK2(self) || PHYS_INPUT_BUTTON_HOOK(self) || PHYS_INPUT_BUTTON_USE(self)))
return;
MapVote_Start();
float t_team = kh_Team_ByID(num);
float players = 0;
FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
- if(!IS_DEAD(it) && !it.BUTTON_CHAT && it.team == t_team)
+ if(!IS_DEAD(it) && !PHYS_INPUT_BUTTON_CHAT(it) && it.team == t_team)
++players;
));
players = 0;
entity my_player = world;
FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
- if(!IS_DEAD(it) && !it.BUTTON_CHAT && it.team == teem)
+ if(!IS_DEAD(it) && !PHYS_INPUT_BUTTON_CHAT(it) && it.team == teem)
{
++players;
if(random() * players <= 1)
PLAYERDEMO_FIELD(func,float,frame) \
PLAYERDEMO_FIELD(func,float,effects) \
/* PLAYERDEMO_FIELD(func,float,switchweapon) */ \
- PLAYERDEMO_FIELD(func,float,BUTTON_ATCK) \
- PLAYERDEMO_FIELD(func,float,BUTTON_ATCK2) \
- PLAYERDEMO_FIELD(func,float,BUTTON_CROUCH) \
- PLAYERDEMO_FIELD(func,float,BUTTON_HOOK) \
- PLAYERDEMO_FIELD(func,float,BUTTON_USE) \
+ PLAYERDEMO_FIELD(func,float,button0) /* TODO: PHYS_INPUT_BUTTON_ATCK */ \
+ PLAYERDEMO_FIELD(func,float,button3) /* TODO: PHYS_INPUT_BUTTON_ATCK2 */ \
+ PLAYERDEMO_FIELD(func,float,button5) /* TODO: PHYS_INPUT_BUTTON_CROUCH */ \
+ PLAYERDEMO_FIELD(func,float,button6) /* TODO: PHYS_INPUT_BUTTON_HOOK */ \
+ PLAYERDEMO_FIELD(func,float,buttonuse) /* TODO: PHYS_INPUT_BUTTON_USE */ \
PLAYERDEMO_FIELD(func,float,flags) \
// end of list
if (actor.(weaponentity).state != WS_CLEAR)
{
Weapon wpn = PS(actor).m_weapon;
- w_ready(wpn, actor, weaponentity, (actor.BUTTON_ATCK ? 1 : 0) | (actor.BUTTON_ATCK2 ? 2 : 0));
+ w_ready(wpn, actor, weaponentity, PHYS_INPUT_BUTTON_ATCK(actor) | (PHYS_INPUT_BUTTON_ATCK2(actor) << 1));
return;
}
}
bool block_weapon = false;
{
- bool key_pressed = actor.BUTTON_HOOK && !actor.vehicle;
+ bool key_pressed = PHYS_INPUT_BUTTON_HOOK(actor) && !actor.vehicle;
Weapon off = actor.offhand;
if (off && !(actor.weapons & WEPSET(HOOK)))
{
W_SwitchWeapon(WEP_HOOK);
actor.hook_switchweapon = key_pressed;
Weapon h = WEP_HOOK;
- block_weapon = (PS(actor).m_weapon == h && (actor.BUTTON_ATCK || key_pressed));
+ block_weapon = (PS(actor).m_weapon == h && (PHYS_INPUT_BUTTON_ATCK(actor) || key_pressed));
h.wr_think(h, actor, weaponentity, block_weapon ? 1 : 0);
}
}
if (w)
{
Weapon e = PS(actor).m_weapon;
- e.wr_think(e, actor, weaponentity, (actor.BUTTON_ATCK ? 1 : 0) | (actor.BUTTON_ATCK2 ? 2 : 0));
+ e.wr_think(e, actor, weaponentity, PHYS_INPUT_BUTTON_ATCK(actor) | (PHYS_INPUT_BUTTON_ATCK2(actor) << 1));
}
else
{
v_up = up;
Weapon wpn = PS(actor).m_weapon;
this.weapon_think(wpn, actor, weaponentity,
- (actor.BUTTON_ATCK ? 1 : 0) | (actor.BUTTON_ATCK2 ? 2 : 0));
+ PHYS_INPUT_BUTTON_ATCK(actor) | (PHYS_INPUT_BUTTON_ATCK2(actor) << 1));
}
else
{
// ATTACK_FINISHED(actor, slot) -= actor.reload_time - 1;
Weapon wpn = Weapons_from(PS(actor).m_weapon.m_id);
- w_ready(wpn, actor, weaponentity, (actor.BUTTON_ATCK ? 1 : 0) | (actor.BUTTON_ATCK2 ? 2 : 0));
+ w_ready(wpn, actor, weaponentity, PHYS_INPUT_BUTTON_ATCK(actor) | (PHYS_INPUT_BUTTON_ATCK2(actor) << 1));
}
void W_Reload(entity actor, float sent_ammo_min, string sent_sound)