コード例 #1
0
 public int TurrestshapeDataFindEmptySeat(coTurretShapeData thisobj, coTurretShape turret, coShapeBase player)
     {
     for (int i = 0; i < thisobj["numMountPoints"].AsInt(); i++)
         {
         int node = turret.getMountNodeObject(i);
         if (node == 0)
             return i;
         }
     return -1;
     }
コード例 #2
0
 public int TurrestShapeDataSwitchSeats(coTurretShapeData thisobj, coTurretShape turret, coShapeBase player)
     {
     for (int i = 0; i < thisobj["numMountPoints"].AsInt(); i++)
         {
         int node = turret.getMountNodeObject(i);
         if (node == player || node != 0)
             continue;
         if (node == 0)
             return i;
         }
     return -1;
     }
コード例 #3
0
        private void TurretShapeData_damage(coTurretShapeData thisobj, coTurretShape turret, TransformF position, coShapeBase sourceobject, float damage, string datatype)
            {
            if (turret.getDamageState() == "Dead")
                return;

            turret.applyDamage(damage);

            // Update the numerical Health HUD
            coShapeBase mountedobject = turret.getObjectMount();

            //if (mountedobject != 0)
            //    console.Call(mountedobject, "updateHealth");
            if (turret.getState() != "Dead")
                return;

            for (int i = 0; i < thisobj["numMountPoints"].AsInt(); i++)
                {
                coShapeBase player = turret.getMountNodeObject(i);
                if (player != 0)
                    console.Call(player, "killWithSource", new[] { "sourceobject", "InsideTurret" });
                }
            }