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 }
public void Update(Seizonsha game, GameEntity entity) { if (recharged < recharge_time) { recharged++; } }
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; }
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)); }
public void Use(Seizonsha game, GameEntity user) { user.color = color; }
public void Update(Seizonsha game, GameEntity entity) { }
public void OnUnequip(Seizonsha game, GameEntity user) { }
public bool Available(Seizonsha game, GameEntity user) { return true; //always true }
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; }
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) { }
public void OnUnequip(Seizonsha game, GameEntity entity) { }
public bool Available(Seizonsha game, GameEntity entity) { return recharged >= recharge_time; }
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); }
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; }