X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fw_fireball.qc;h=e78bb2bbc3b1c03ace99f72afcf8f9b280b8430c;hb=d561f76342a7e8060a5a1aae4bab3f2bf56c17aa;hp=6bccb7e3f6dbfd2f7c455456197ea6586d0c2073;hpb=58b26c0a303456441dbb82e608213d2f86d695d8;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/w_fireball.qc b/qcsrc/server/w_fireball.qc index 6bccb7e3f..e78bb2bbc 100644 --- a/qcsrc/server/w_fireball.qc +++ b/qcsrc/server/w_fireball.qc @@ -1,6 +1,7 @@ #ifdef REGISTER_WEAPON REGISTER_WEAPON(FIREBALL, w_fireball, IT_FUEL, 9, WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "fireball", "fireball", "Fireball"); #else +#ifdef SVQC .float bot_primary_fireballmooth; // whatever a mooth is .vector fireball_impactvec; .float fireball_primarytime; @@ -98,6 +99,7 @@ void W_Fireball_Think() if(time > self.pushltime) { self.cnt = 1; + self.projectiledeathtype |= HITTYPE_SPLASH; W_Fireball_Explode(); return; } @@ -153,6 +155,8 @@ void W_Fireball_Attack1() proj.flags = FL_PROJECTILE; CSQCProjectile(proj, TRUE, PROJECTILE_FIREBALL, TRUE); + + other = proj; MUTATOR_CALLHOOK(EditProjectile); } void W_Fireball_AttackEffect(float i, vector f_diff) @@ -287,6 +291,8 @@ void W_Fireball_Attack2() proj.flags = FL_PROJECTILE; CSQCProjectile(proj, TRUE, PROJECTILE_FIREMINE, TRUE); + + other = proj; MUTATOR_CALLHOOK(EditProjectile); } void spawnfunc_weapon_fireball (void) @@ -321,13 +327,13 @@ float w_fireball(float req) { if (self.BUTTON_ATCK) if (time >= self.fireball_primarytime) - if (weapon_prepareattack(1, cvar("g_balance_fireball_primary_refire"))) + if (weapon_prepareattack(0, cvar("g_balance_fireball_primary_refire"))) { W_Fireball_Attack1_Frame0(); self.fireball_primarytime = time + cvar("g_balance_fireball_primary_refire2"); } if (self.BUTTON_ATCK2) - if (weapon_prepareattack(0, cvar("g_balance_fireball_secondary_refire"))) + if (weapon_prepareattack(1, cvar("g_balance_fireball_secondary_refire"))) { W_Fireball_Attack2(); weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_fireball_secondary_animtime"), w_ready); @@ -337,7 +343,7 @@ float w_fireball(float req) { precache_model ("models/weapons/g_fireball.md3"); precache_model ("models/weapons/v_fireball.md3"); - precache_model ("models/weapons/h_fireball.dpm"); + precache_model ("models/weapons/h_fireball.iqm"); precache_model ("models/sphere/sphere.md3"); precache_sound ("weapons/fireball_fire.wav"); precache_sound ("weapons/fireball_fire2.wav"); @@ -349,45 +355,67 @@ float w_fireball(float req) return self.ammo_fuel >= cvar("g_balance_fireball_primary_ammo"); else if (req == WR_CHECKAMMO2) return self.ammo_fuel >= cvar("g_balance_fireball_secondary_ammo"); + else if (req == WR_RESETPLAYER) + { + self.fireball_primarytime = time; + } + return TRUE; +}; +#endif +#ifdef CSQC +float w_fireball(float req) +{ + if(req == WR_IMPACTEFFECT) + { + vector org2; + if(w_deathtype & HITTYPE_SECONDARY) + { + // firemine goes out silently + } + else + { + org2 = w_org + w_backoff * 16; + pointparticles(particleeffectnum("fireball_explode"), org2, '0 0 0', 1); + if(!w_issilent) + sound(self, CHAN_PROJECTILE, "weapons/fireball_impact2.wav", VOL_BASE, ATTN_NORM * 0.25); // long range boom + } + } + else if(req == WR_PRECACHE) + { + precache_sound("weapons/fireball_impact2.wav"); + } else if (req == WR_SUICIDEMESSAGE) { if(w_deathtype & HITTYPE_SECONDARY) - w_deathtypestring = "forgot about some firemine"; + w_deathtypestring = "%s forgot about some firemine"; else - w_deathtypestring = "should have used a smaller gun"; + w_deathtypestring = "%s should have used a smaller gun"; } else if (req == WR_KILLMESSAGE) { if(w_deathtype & HITTYPE_SECONDARY) { if(w_deathtype & HITTYPE_HEADSHOT) - w_deathtypestring = "tried to catch #'s firemine"; + w_deathtypestring = "%s tried to catch %s's firemine"; else - w_deathtypestring = "fatefully ignored #'s firemine"; + w_deathtypestring = "%s fatefully ignored %s's firemine"; } else { if(w_deathtype & HITTYPE_BOUNCE) { if(w_deathtype & HITTYPE_SPLASH) // BFG effect - { - w_deathtypestring = "could not hide from #'s fireball"; - } + w_deathtypestring = "%s could not hide from %s's fireball"; else // laser - { - w_deathtypestring = "saw the pretty lights of #'s fireball"; - } + w_deathtypestring = "%s saw the pretty lights of %s's fireball"; } else if(w_deathtype & HITTYPE_SPLASH) - w_deathtypestring = "got too close to #'s fireball"; + w_deathtypestring = "%s got too close to %s's fireball"; else - w_deathtypestring = "tasted #'s fireball"; + w_deathtypestring = "%s tasted %s's fireball"; } } - else if (req == WR_RESETPLAYER) - { - self.fireball_primarytime = time; - } return TRUE; -}; +} +#endif #endif