Ejemplo n.º 1
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
        }
Ejemplo n.º 2
0
 public void Update(Seizonsha game, GameEntity entity)
 {
     if (recharged < recharge_time)
     {
         recharged++;
     }
 }
Ejemplo n.º 3
0
 public Bullet(Seizonsha game, Texture2D sprite, Rectangle bounds, int amount, int damageType, int duration, Vector2 bulletSpeed, Vector2 alexDirection)
     : base(game, sprite, bounds.Left, bounds.Top, bounds.Width, bounds.Height, duration)
 {
     this.amount = amount;
     this.damageType = damageType;
     this.bulletSpeed = bulletSpeed;
     this.direction = alexDirection;
 }
Ejemplo n.º 4
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));
 }
Ejemplo n.º 5
0
 public void Use(Seizonsha game, GameEntity user)
 {
     user.color = color;
 }
Ejemplo n.º 6
0
 public void Update(Seizonsha game, GameEntity entity)
 {
 }
Ejemplo n.º 7
0
 public void OnUnequip(Seizonsha game, GameEntity user)
 {
 }
Ejemplo n.º 8
0
 public bool Available(Seizonsha game, GameEntity user)
 {
     return true;  //always true
 }
Ejemplo n.º 9
0
 public TextEffect(Seizonsha game, string text, int duration, int x, int y)
     : base(game, null, x, y, 0, 0, duration)
 {
     incVelocityY(-3);
     this.text = text;
 }
Ejemplo n.º 10
0
 public BasicNPC(Seizonsha game, Texture2D sprite, int x, int y, int width, int height)
     : base(game, sprite, x, y, width, height, Static.DAMAGE_TYPE_ENEMY, 20)
 {
 }
Ejemplo n.º 11
0
 public void OnUnequip(Seizonsha game, GameEntity entity)
 {
 }
Ejemplo n.º 12
0
 public bool Available(Seizonsha game, GameEntity entity)
 {
     return recharged >= recharge_time;
 }
Ejemplo n.º 13
0
 public Effect(Seizonsha game, Texture2D sprite, int x, int y, int width, int height, int duration)
     : base(game, sprite, x, y, width, height, Static.TARGET_TYPE_NOT_DAMAGEABLE, 0)
 {
     this.duration = duration;
     setCollidable(false);
 }
Ejemplo n.º 14
0
 public SwordSlash(Seizonsha game, Texture2D sprite, Rectangle bounds, int amount, int damageType, int duration)
     : base(game, sprite, bounds.Left, bounds.Top, bounds.Width, bounds.Height, duration)
 {
     this.amount = amount;
     this.damageType = damageType;
 }