public BonusItem(Bonustype Bonustype,float power, int remainUsetime) { this.Bonustype = Bonustype; this.power = power; this.remainUsetime = remainUsetime; Slot = Slot.bonus; }
public BonusItem(Bonustype Bonustype,float power, int remainUsetime) { this.Bonustype = Bonustype; this.power = power; this.remainUsetime = remainUsetime; cost = Formuls.CostBonus(Bonustype, MainController.Instance.PlayerData.Level) * (remainUsetime/ BONUS_USE_TIME); IconSprite = UnityEngine.Resources.Load<Sprite>("sprites/BonusItem/" + Bonustype.ToString()); Slot = Slot.bonus; }
public static int CostBonus(Bonustype Bonustype, int lvl) { return 500*lvl; }
private void Halt() { if (!halt.IsRunning) halt.Start(); if (Helper.Rng(31337) % 2 == 0) type = Bonustype.Nuke; else type = Bonustype.Life; bonusPosition.X = Game.WIDTH + bonus.Width; bonusPosition.Y = Helper.Rng(Game.HEIGHT - bonus.Height); haltDuration = Helper.Rng2(10000,20000); // Check if it needs to be drawn. if (halt.ElapsedMilliseconds > haltDuration) { state = Bonusstate.Traverse; halt.Reset(); } }