public Monster(FightScene fightScene) { Hitpoint.Val = 30; this.fightScene = fightScene; GameObject gObject = GameObject.FindGameObjectsWithTag("Placeholder").Single(o => o.name == "Monster"); this.renderer = gObject.AddComponent <MonsterRenderer> (); this.renderer.Register(this); Hitpoint.OnChange += (oldVal, newVal) => { if (newVal < oldVal) { this.renderer.Shake(); } if (newVal <= 0) { onDeath(); } }; this.States = new StatesBar(gObject); }
public Player(FightScene fightScene) { this.fightScene = fightScene; this.gameStats = GameObject.FindGameObjectWithTag("GameStatsPersistor") .GetComponent <GameStatsPersistor> ().GameStats; // init for Fight Scene this.Hitpoint.Val = this.fightScene.GameStats.Hitpoint; this.MaxHitpoint = this.fightScene.GameStats.MaxHitpoint; this.Shield.Val = 0; this.Hitpoint.OnChange += (oldVal, newVal) => { if (newVal <= 0) { onDeath(); } }; this.playerObject = GameObject.FindGameObjectsWithTag("Placeholder").Single(o => o.name == "Player"); this.playerRenderer = playerObject.AddComponent <PlayerRenderer>(); this.playerRenderer.Register(this); this.States = new StatesBar(playerObject); }
public override void ApplyEffect(StatesBar states) { states.EnergyModifier = 0; }
public override void ApplyEffect(StatesBar states) { states.ExtraCardsNum += 2; }
public virtual void ApplyEffect(StatesBar states) { }
public void Register(StatesBar states) { this.states = states; }
public override void ApplyEffect(StatesBar states) { states.DamageModifier *= 0.75f; }
public void Awake() { this.FightScene = Camera.main.GetComponent<FightScene>(); this.handObject = this.gameObject; this.States = new StatesBar (handObject); this.drawPerTurn = this.FightScene.GameStats.GetSpeed(); }
public override void ApplyEffect(StatesBar states) { states.AllowDraw = false; }
public override void ApplyEffect(StatesBar states) { states.DamageTookModifier *= 1.5f; }