]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/vehicles/vehicle/raptor_weapons.qc
Remove .move_* fields and MOVETYPE_PUSH logic (doesn't work)
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / vehicles / vehicle / raptor_weapons.qc
index 1aca463811c90bd3fa4d72d91a3083d1585dfada..f1357f306c49e389bd43c070101c55182c2c7759 100644 (file)
@@ -53,7 +53,7 @@ METHOD(RaptorBomb, wr_think, void(entity thiswep, entity actor, .entity weaponen
 
 void raptor_flare_think(entity this);
 void raptor_flare_damage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force);
-void raptor_flare_touch(entity this);
+void raptor_flare_touch(entity this, entity toucher);
 
 METHOD(RaptorFlare, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) {
     bool isPlayer = IS_PLAYER(actor);
@@ -87,33 +87,33 @@ METHOD(RaptorFlare, wr_think, void(entity thiswep, entity actor, .entity weapone
 
 void raptor_bomblet_boom(entity this)
 {
-    RadiusDamage (self, self.realowner, autocvar_g_vehicle_raptor_bomblet_damage,
+    RadiusDamage (this, this.realowner, autocvar_g_vehicle_raptor_bomblet_damage,
                                     autocvar_g_vehicle_raptor_bomblet_edgedamage,
-                                    autocvar_g_vehicle_raptor_bomblet_radius, world, world,
-                                    autocvar_g_vehicle_raptor_bomblet_force, DEATH_VH_RAPT_BOMB.m_id, world);
-    remove(self);
+                                    autocvar_g_vehicle_raptor_bomblet_radius, NULL, NULL,
+                                    autocvar_g_vehicle_raptor_bomblet_force, DEATH_VH_RAPT_BOMB.m_id, NULL);
+    remove(this);
 }
 
-void raptor_bomblet_touch(entity this)
+void raptor_bomblet_touch(entity this, entity toucher)
 {
-    if(other == self.owner)
+    if(toucher == this.owner)
         return;
 
-    PROJECTILE_TOUCH(this);
-    setthink(self, raptor_bomblet_boom);
-    self.nextthink = time + random() * autocvar_g_vehicle_raptor_bomblet_explode_delay;
+    PROJECTILE_TOUCH(this, toucher);
+    setthink(this, raptor_bomblet_boom);
+    this.nextthink = time + random() * autocvar_g_vehicle_raptor_bomblet_explode_delay;
 }
 
 void raptor_bomb_burst(entity this)
 {
-    if(self.cnt > time)
+    if(this.cnt > time)
     if(autocvar_g_vehicle_raptor_bomblet_alt)
     {
-        self.nextthink = time;
-        traceline(self.origin, self.origin + (normalize(self.velocity) * autocvar_g_vehicle_raptor_bomblet_alt), MOVE_NORMAL, self);
-        if((trace_fraction == 1.0) || (vdist(self.origin - self.owner.origin, <, autocvar_g_vehicle_raptor_bomblet_radius)))
+        this.nextthink = time;
+        traceline(this.origin, this.origin + (normalize(this.velocity) * autocvar_g_vehicle_raptor_bomblet_alt), MOVE_NORMAL, this);
+        if((trace_fraction == 1.0) || (vdist(this.origin - this.owner.origin, <, autocvar_g_vehicle_raptor_bomblet_radius)))
         {
-            UpdateCSQCProjectile(self);
+            UpdateCSQCProjectile(this);
             return;
         }
     }
@@ -121,26 +121,31 @@ void raptor_bomb_burst(entity this)
     entity bomblet;
     float i;
 
-    Damage_DamageInfo(self.origin, 0, 0, 0, '0 0 0', DEATH_VH_RAPT_FRAGMENT.m_id, 0, self);
+    Damage_DamageInfo(this.origin, 0, 0, 0, '0 0 0', DEATH_VH_RAPT_FRAGMENT.m_id, 0, this);
 
     for(i = 0; i < autocvar_g_vehicle_raptor_bomblets; ++i)
     {
         bomblet = spawn();
-        setorigin(bomblet, self.origin);
+        setorigin(bomblet, this.origin);
 
         bomblet.movetype       = MOVETYPE_TOSS;
         settouch(bomblet, raptor_bomblet_touch);
         setthink(bomblet, raptor_bomblet_boom);
         bomblet.nextthink   = time + 5;
-        bomblet.owner     = self.owner;
-        bomblet.realowner   = self.realowner;
-        bomblet.velocity       = normalize(normalize(self.velocity) + (randomvec() * autocvar_g_vehicle_raptor_bomblet_spread)) * vlen(self.velocity);
+        bomblet.owner     = this.owner;
+        bomblet.realowner   = this.realowner;
+        bomblet.velocity       = normalize(normalize(this.velocity) + (randomvec() * autocvar_g_vehicle_raptor_bomblet_spread)) * vlen(this.velocity);
 
         PROJECTILE_MAKETRIGGER(bomblet);
         CSQCProjectile(bomblet, true, PROJECTILE_RAPTORBOMBLET, true);
     }
 
-    remove(self);
+    remove(this);
+}
+
+void raptor_bomb_touch(entity this, entity toucher)
+{
+       raptor_bomb_burst(this);
 }
 
 void raptor_bombdrop(entity this)
@@ -157,8 +162,8 @@ void raptor_bombdrop(entity this)
 
     bomb_1.movetype     = bomb_2.movetype   = MOVETYPE_BOUNCE;
     bomb_1.velocity     = bomb_2.velocity   = this.velocity;
-    settouch(bomb_1, raptor_bomb_burst);
-    settouch(bomb_2, raptor_bomb_burst);
+    settouch(bomb_1, raptor_bomb_touch);
+    settouch(bomb_2, raptor_bomb_touch);
     setthink(bomb_1, raptor_bomb_burst);
     setthink(bomb_2, raptor_bomb_burst);
     bomb_1.cnt           = bomb_2.cnt          = time + 10;
@@ -180,7 +185,7 @@ void raptor_bombdrop(entity this)
     CSQCProjectile(bomb_2, true, PROJECTILE_RAPTORBOMB, true);
 }
 
-void raptor_flare_touch(entity this)
+void raptor_flare_touch(entity this, entity toucher)
 {
     remove(this);
 }
@@ -194,19 +199,19 @@ void raptor_flare_damage(entity this, entity inflictor, entity attacker, float d
 
 void raptor_flare_think(entity this)
 {
-    self.nextthink = time + 0.1;
-    entity _missile = findchainentity(enemy, self.owner);
+    this.nextthink = time + 0.1;
+    entity _missile = findchainentity(enemy, this.owner);
     while(_missile)
     {
         if(_missile.flags & FL_PROJECTILE)
-        if(vdist(self.origin - _missile.origin, <, autocvar_g_vehicle_raptor_flare_range))
+        if(vdist(this.origin - _missile.origin, <, autocvar_g_vehicle_raptor_flare_range))
         if(random() > autocvar_g_vehicle_raptor_flare_chase)
-            _missile.enemy = self;
+            _missile.enemy = this;
         _missile = _missile.chain;
     }
 
-    if(self.tur_impacttime < time)
-        remove(self);
+    if(this.tur_impacttime < time)
+        remove(this);
 }
 
 #endif
@@ -219,7 +224,7 @@ void RaptorCBShellfragDraw(entity this)
         return;
 
     Movetype_Physics_MatchTicrate(this, autocvar_cl_gibs_ticrate, autocvar_cl_gibs_sloppy);
-    this.move_avelocity += randomvec() * 15;
+    this.avelocity += randomvec() * 15;
     this.renderflags = 0;
 
     if(this.cnt < time)
@@ -241,10 +246,9 @@ void RaptorCBShellfragToss(vector _org, vector _vel, vector _ang)
 
     sfrag.draw = RaptorCBShellfragDraw;
 
-    sfrag.move_origin = sfrag.origin = _org;
-    sfrag.move_velocity = _vel;
-    sfrag.move_avelocity = prandomvec() * vlen(sfrag.move_velocity);
-    sfrag.angles = sfrag.move_angles = _ang;
+    sfrag.velocity = _vel;
+    sfrag.avelocity = prandomvec() * vlen(sfrag.velocity);
+    sfrag.angles = _ang;
 
     sfrag.move_time = time;
     sfrag.damageforcescale = 4;