Example #1
0
        public override void onImpact(ShapeBase obj, SceneObject collObj, Point3F vec, float len)
        {
            Player     player = obj.getId();
            TransformF p      = player.getTransform() + new TransformF(vec);

            float speedDamageScale = len + this["speedDamageScale"].AsFloat();

            //Do not confuse the player.event_damage with the PlayerData.event_damage...
            player.damage(0, p.GetPosition(), speedDamageScale, "Impact");
        }
        public override void damage(ShapeBase obj, Point3F position, GameBase source, float damage, string damagetype)
        {
            if (obj.getDamageState() == "Dead")
            {
                return;
            }

            obj.applyDamage(damage);

            for (int i = 0; i < this["numMountPoints"].AsInt(); i++)
            {
                Player player = obj.getMountNodeObject(i);
                if (player != 0)
                {
                    player.damage(source, position, 10000.0f, "");
                }
            }
        }