Exemplo n.º 1
0
 public void Use(Seizonsha game, GameEntity entity)
 {
     if (entity.isFrozen())
     {
         return;
     }
     recharged = 0;
     entity.Freeze(recharge_time);
     int damageType = Static.DAMAGE_TYPE_NO_DAMAGE;
     if (entity.getTargetType() == Static.TARGET_TYPE_FRIENDLY){
         damageType = Static.DAMAGE_TYPE_FRIENDLY;
     }
     if (entity.getTargetType() == Static.TARGET_TYPE_ENEMY){
         damageType = Static.DAMAGE_TYPE_ENEMY;
     }
     Rectangle slashBounds = new Rectangle(entity.getCenterX()+(int)(entity.width/2 * Math.Cos(entity.getDirectionAngle())), entity.getCenterY() - (int)(entity.height/2 * Math.Sin(entity.getDirectionAngle())), Static.PLAYER_WIDTH/2, Static.PLAYER_HEIGHT/2);
     game.Spawn(new SwordSlash(game, game.getTestSprite(slashBounds, Color.Green), slashBounds, damage, damageType, 10));
 }
Exemplo n.º 2
0
        public void Use(Seizonsha game, GameEntity entity)
        {
            // entity is whatever is using this

            //			if (entity.isFrozen())
            //			{
            //				return;
            //			}
            recharged = 0;
            // entity.Freeze(recharge_time);
            int damageType = Static.DAMAGE_TYPE_NO_DAMAGE;
            if (entity.getTargetType() == Static.TARGET_TYPE_FRIENDLY){
                damageType = Static.DAMAGE_TYPE_FRIENDLY;
            }
            if (entity.getTargetType() == Static.TARGET_TYPE_ENEMY){
                damageType = Static.DAMAGE_TYPE_ENEMY;
            }
            Rectangle slashBounds = new Rectangle(	entity.getCenterX(),
                                                    entity.getCenterY(),
                                                    Static.PLAYER_WIDTH/2,
                                                    Static.PLAYER_HEIGHT/2);

            //Rectangle bulletBounds = new Rectangle(

            game.Spawn(new Bullet(game, game.getTestSprite(slashBounds, Color.Red), slashBounds, damage, damageType, 1, bulletSpeed, entity.alexDirection));

            // game sprite bounds amount dmgAmount dmgType duration bulletSpeed
        }