(trueaim_rifle = new_pure(trueaim_rifle)).dphitcontentsmask = DPCONTENTS_BODY | DPCONTENTS_CORPSE;
}
-float EnemyHitCheck()
+int EnemyHitCheck()
{
float t, n;
wcross_origin = project_3d_to_2d(trace_endpos);
return SHOTTYPE_HITENEMY;
}
-float TrueAimCheck(entity wepent)
+int TrueAimCheck(entity wepent)
{
- if(wepent.activeweapon.spawnflags & WEP_FLAG_NOTRUEAIM)
+ Weapon wep = wepent.activeweapon;
+ if(wep.spawnflags & WEP_FLAG_NOTRUEAIM)
return SHOTTYPE_HITWORLD;
float nudge = 1; // added to traceline target and subtracted from result TOOD(divVerent): do we still need this? Doesn't the engine do this now for us?
ta = trueaim;
mv = MOVE_NOMONSTERS;
- switch(wepent.activeweapon) // WEAPONTODO
- {
- case WEP_VORTEX:
- case WEP_OVERKILL_NEX:
- case WEP_VAPORIZER:
- mv = MOVE_NORMAL;
- break;
- case WEP_RIFLE:
- ta = trueaim_rifle;
- mv = MOVE_NORMAL;
- if(zoomscript_caught)
- {
- tracebox(view_origin, '0 0 0', '0 0 0', view_origin + view_forward * max_shot_distance, mv, ta);
- return EnemyHitCheck();
- }
- break;
- case WEP_DEVASTATOR: // projectile has a size!
- mi = '-3 -3 -3';
- ma = '3 3 3';
- break;
- case WEP_FIREBALL: // projectile has a size!
- mi = '-16 -16 -16';
- ma = '16 16 16';
- break;
- case WEP_SEEKER: // projectile has a size!
- mi = '-2 -2 -2';
- ma = '2 2 2';
- break;
- case WEP_ELECTRO: // projectile has a size!
- mi = '0 0 -3';
- ma = '0 0 -3';
- break;
- }
+ if(wep.spawnflags & WEP_TYPE_HITSCAN)
+ mv = MOVE_NORMAL; // accurate enemy hit detection
+
+ if(wep == WEP_RIFLE)
+ ta = trueaim_rifle; // WEAPONTODO
vector traceorigin = entcs_receiver(player_localentnum - 1).origin + (eZ * STAT(VIEWHEIGHT));
EFFECT(0, ITEM_RESPAWN, "item_respawn")
EFFECT(0, ITEM_DESPAWN, "item_despawn")
+// FIXME: needs custom effect
+EFFECT(0, ONS_ELECTRICITY_EXPLODE, "electro_ballexplode")
EFFECT(0, ONS_GENERATOR_DAMAGED, "torch_small")
EFFECT(0, ONS_GENERATOR_GIB, "onslaught_generator_gib_explode")
EFFECT(0, ONS_GENERATOR_EXPLODE, "onslaught_generator_smallexplosion")
EFFECT(0, ONS_GENERATOR_EXPLODE2, "onslaught_generator_finalexplosion")
+// FIXME: needs custom effect
+EFFECT(0, ONS_SHOCKWAVE, "electro_combo")
+// FIXME: needs custom effect
+EFFECT(0, KA_BALL_RESPAWN, "electro_combo")
EFFECT(0, LASER_DEADLY, "laser_deadly")
this.nextthink = time + autocvar_g_keepawayball_respawntime;
navigation_dynamicgoal_set(this, NULL);
- Send_Effect(EFFECT_ELECTRO_COMBO, oldballorigin, '0 0 0', 1);
- Send_Effect(EFFECT_ELECTRO_COMBO, this.origin, '0 0 0', 1);
+ Send_Effect(EFFECT_KA_BALL_RESPAWN, oldballorigin, '0 0 0', 1);
+ Send_Effect(EFFECT_KA_BALL_RESPAWN, this.origin, '0 0 0', 1);
WaypointSprite_Spawn(WP_KaBall, 0, 0, this, '0 0 64', NULL, this.team, this, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER);
WaypointSprite_Ping(this.waypointsprite_attachedforcarrier);
if(random() < 0.9 - GetResource(this, RES_HEALTH) / this.max_health)
if(random() < 0.01)
{
- pointparticles(EFFECT_ELECTRO_BALLEXPLODE, this.origin + randompos('-50 -50 -20', '50 50 50'), '0 0 0', 1);
+ pointparticles(EFFECT_ONS_ELECTRICITY_EXPLODE, this.origin + randompos('-50 -50 -20', '50 50 50'), '0 0 0', 1);
sound(this, CH_TRIGGER, SND_ONS_ELECTRICITY_EXPLODE, VOL_BASE, ATTEN_NORM);
}
else
if(this.count==40||this.count==20)
{
sound(this, CH_TRIGGER, SND_ONS_SHOCKWAVE, VOL_BASE, ATTEN_NORM);
- pointparticles(EFFECT_ELECTRO_COMBO, this.origin, '0 0 0', 6);
+ pointparticles(EFFECT_ONS_SHOCKWAVE, this.origin, '0 0 0', 6);
}
// rays
this.nextthink = time + autocvar_g_tkaball_respawntime;
navigation_dynamicgoal_set(this, NULL);
- Send_Effect(EFFECT_ELECTRO_COMBO, oldballorigin, '0 0 0', 1);
- Send_Effect(EFFECT_ELECTRO_COMBO, this.origin, '0 0 0', 1);
+ Send_Effect(EFFECT_KA_BALL_RESPAWN, oldballorigin, '0 0 0', 1);
+ Send_Effect(EFFECT_KA_BALL_RESPAWN, this.origin, '0 0 0', 1);
WaypointSprite_Spawn(WP_KaBall, 0, 0, this, '0 0 64', NULL, this.team, this, waypointsprite_attachedforcarrier, false, RADARICON_FLAGCARRIER);
WaypointSprite_Ping(this.waypointsprite_attachedforcarrier);
return REGISTRY_GET(Sounds, SND_RIC1.m_id + rint(random() * 2));
}
-SOUND(ROCKET_IMPACT, W_Sound("rocket_impact"));
+SOUND(ROCKET_IMPACT, W_Sound("rocket_impact")); // heavily used as a generic explosion sound
SOUND(STRENGTH_FIRE, W_Sound("strength_fire"));
SOUND(UNAVAILABLE, W_Sound("unavailable"));
SOUND(WEAPONPICKUP, W_Sound("weaponpickup"));
METHOD(EWheelAttack, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) {
bool isPlayer = IS_PLAYER(actor);
if (fire & 1)
- if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(WEP_ELECTRO, refire))) {
+ if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, 1)) {
if (isPlayer) {
turret_initparams(actor);
W_SetupShot_Dir(actor, weaponentity, v_forward, false, 0, SND_EWheelAttack_FIRE, CH_WEAPON_B, 0, DEATH_TURRET_EWHEEL.m_id);
actor.tur_shotdir_updated = w_shotdir;
actor.tur_shotorg = w_shotorg;
actor.tur_head = actor;
- weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(WEP_ELECTRO, animtime), w_ready);
+ weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, 0.5, w_ready);
}
turret_do_updates(actor);
METHOD(FlacAttack, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) {
bool isPlayer = IS_PLAYER(actor);
if (fire & 1)
- if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(WEP_ELECTRO, refire))) {
+ if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, 1)) {
if (isPlayer) {
turret_initparams(actor);
W_SetupShot_Dir(actor, weaponentity, v_forward, false, 0, SND_FlacAttack_FIRE, CH_WEAPON_B, 0, DEATH_TURRET_FLAC.m_id);
actor.tur_shotorg = w_shotorg;
actor.tur_head = actor;
actor.tur_impacttime = 10;
- weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(WEP_ELECTRO, animtime), w_ready);
+ weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, 0.5, w_ready);
}
turret_tag_fire_update(actor);
METHOD(HellionAttack, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) {
bool isPlayer = IS_PLAYER(actor);
if (fire & 1)
- if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(WEP_ELECTRO, refire))) {
+ if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, 1)) {
if (isPlayer) {
turret_initparams(actor);
W_SetupShot_Dir(actor, weaponentity, v_forward, false, 0, SND_HellionAttack_FIRE, CH_WEAPON_B, 0, DEATH_TURRET_HELLION.m_id);
actor.tur_shotorg = w_shotorg;
actor.tur_head = actor;
actor.shot_radius = 500;
- weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(WEP_ELECTRO, animtime), w_ready);
+ weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, 0.5, w_ready);
}
if (!isPlayer) {
if (actor.tur_head.frame != 0)
{
bool isPlayer = IS_PLAYER(actor);
if (fire & 1)
- if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(WEP_ELECTRO, refire))) {
+ if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, 1)) {
if (isPlayer) {
turret_initparams(actor);
W_SetupShot_Dir(actor, weaponentity, v_forward, false, 0, SND_HunterKillerAttack_FIRE, CH_WEAPON_B, 0, DEATH_TURRET_HK.m_id);
actor.tur_shotdir_updated = w_shotdir;
actor.tur_shotorg = w_shotorg;
actor.tur_head = actor;
- weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(WEP_ELECTRO, animtime), w_ready);
+ weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, 0.5, w_ready);
}
entity missile = turret_projectile(actor, SND_HunterKillerAttack_FIRE, 6, 10, DEATH_TURRET_HK.m_id, PROJECTILE_ROCKET, false, false);
te_explosion (missile.origin);
{
bool isPlayer = IS_PLAYER(actor);
if (fire & 1)
- if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(WEP_ELECTRO, refire))) {
+ if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, 1)) {
if (isPlayer) {
turret_initparams(actor);
W_SetupShot_Dir(actor, weaponentity, v_forward, false, 0, SND_PhaserTurretAttack_FIRE, CH_WEAPON_B, 0, DEATH_TURRET_PHASER.m_id);
actor.tur_shotorg = w_shotorg;
actor.tur_head = actor;
actor.shot_speed = 1;
- weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(WEP_ELECTRO, animtime), w_ready);
+ weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, 0.5, w_ready);
}
entity beam = new(PhaserTurret_beam);
setmodel(beam, MDL_TUR_PHASER_BEAM);
METHOD(PlasmaAttack, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) {
bool isPlayer = IS_PLAYER(actor);
if (fire & 1)
- if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(WEP_ELECTRO, refire))) {
+ if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, 1)) {
if (isPlayer) {
turret_initparams(actor);
W_SetupShot_Dir(actor, weaponentity, v_forward, false, 0, SND_PlasmaAttack_FIRE, CH_WEAPON_B, 0, DEATH_TURRET_PLASMA.m_id);
actor.tur_shotdir_updated = w_shotdir;
actor.tur_shotorg = w_shotorg;
actor.tur_head = actor;
- weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(WEP_ELECTRO, animtime), w_ready);
+ weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, 0.5, w_ready);
}
entity missile = turret_projectile(actor, SND_PlasmaAttack_FIRE, 1, 0, DEATH_TURRET_PLASMA.m_id, PROJECTILE_ELECTRO_BEAM, true, true);
missile.missile_flags = MIF_SPLASH;
METHOD(TeslaCoilTurretAttack, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) {
bool isPlayer = IS_PLAYER(actor);
if (fire & 1)
- if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(WEP_ELECTRO, refire))) {
+ if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, 1)) {
if (isPlayer) {
turret_initparams(actor);
W_SetupShot_Dir(actor, weaponentity, v_forward, false, 0, SND_TeslaCoilTurretAttack_FIRE, CH_WEAPON_B, 0, DEATH_TURRET_TESLA.m_id);
actor.tur_shotdir_updated = w_shotdir;
actor.tur_shotorg = w_shotorg;
actor.tur_head = actor;
- weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(WEP_ELECTRO, animtime), w_ready);
+ weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, 0.5, w_ready);
}
float d = actor.shot_dmg;
METHOD(WalkerTurretAttack, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) {
bool isPlayer = IS_PLAYER(actor);
if (fire & 1)
- if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, WEP_CVAR_PRI(WEP_ELECTRO, refire))) {
+ if (!isPlayer || weapon_prepareattack(thiswep, actor, weaponentity, false, 1)) {
if (isPlayer) {
turret_initparams(actor);
W_SetupShot_Dir(actor, weaponentity, v_forward, false, 0, SND_WalkerTurretAttack_FIRE, CH_WEAPON_B, 0, DEATH_TURRET_WALK_GUN.m_id);
actor.tur_shotdir_updated = w_shotdir;
actor.tur_shotorg = w_shotorg;
actor.tur_head = actor;
- weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, WEP_CVAR_PRI(WEP_ELECTRO, animtime), w_ready);
+ weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, 0.5, w_ready);
}
sound (actor, CH_WEAPON_A, SND_WalkerTurretAttack_FIRE, VOL_BASE, ATTEN_NORM);
fireBullet(actor, weaponentity, actor.tur_shotorg, actor.tur_shotdir_updated, actor.shot_spread, 0, actor.shot_dmg, 0, actor.shot_force, DEATH_TURRET_WALK_GUN.m_id, EFFECT_BULLET);