public void Affect(Effect e, Level currentLevel, bool mute) { switch(e.type) { case "blind": blind = e.magnitude; if (!mute) message.Add("Your eyes! YOUR EYES OR OTHER SENSORY ORGAN(S)!"); break; case "choke": hp -= e.magnitude; if (!mute) message.Add("Hrk! You can't breathe."); break; case "confuse": confusion = e.magnitude; if (!mute) message.Add("Has anyone really been far as decided to use even to go want to do more like?"); break; case "detect monster": detectMonster = e.magnitude; if (!mute) message.Add("You feel a sense of presence."); break; case "detect item": detectItem = e.magnitude; if (!mute) message.Add("You feel an intuition about treasure."); break; case "gain ability": strength += (byte) rngDie.Roll(e.magnitude); dexterity += (byte)rngDie.Roll(e.magnitude); constitution += (byte)rngDie.Roll(e.magnitude); intelligence += (byte)rngDie.Roll(e.magnitude); wisdom += (byte)rngDie.Roll(e.magnitude); charisma += (byte)rngDie.Roll(e.magnitude); if (strength > 18) strength = 18; if (dexterity > 18) dexterity = 18; if (constitution > 18) constitution = 18; if (intelligence > 18) intelligence = 18; if (wisdom > 18) wisdom = 18; if (charisma > 18) charisma = 18; if (!mute) message.Add("Oh, wow... you feel awesome."); break; case "heal": foreach (BodyPart b in anatomy) { b.currentHealth += (int)(b.maxHealth * 0.25f); if (b.currentHealth > b.maxHealth) b.currentHealth = b.maxHealth; } hp += e.magnitude; if (hp > hpMax) hp = hpMax; if (!mute) message.Add("You feel better."); break; case "invisibility": invisibility = e.magnitude; if (!mute) { message.Add("Your body becomes transparent."); message.Add("Monsters seem to still sense you, though. Somehow."); } break; case "level up": LevelUpForSlayingImp(); if (!mute) message.Add("You feel more experienced."); break; case "levitation": levitate = e.magnitude; if (!mute) message.Add("You float up off the ground."); break; case "paralyze": status_paralyzed = (byte)e.magnitude; if (!mute) message.Add("You're rooted to the spot!"); break; case "poison": hp -= e.magnitude; if (!mute) message.Add("You don't feel so well"); break; case "polymorph": if (!mute) { message.Add("You don't feel like yourself."); message.Add("Actually, you feel like the universe is too lazy to make anything happen yet."); } break; case "regenerate body part": if (lostParts.Count > 0) { lostParts[0].currentHealth = lostParts[0].maxHealth; //Heal part anatomy.Add(lostParts[0]); //Restore part if (!mute) message.Add("A shiver runs through your body, and your missing " + lostParts[0].name + " grows back where it once was, good as new."); lostParts.RemoveAt(0); } else { if (!mute) message.Add("A tingling runs through your body briefly."); } break; case "revive": revive = e.magnitude; if (!mute) message.Add("You are quite certain that nothing bad will happen. Nothing at all."); break; case "see invisible": seeInvisible = e.magnitude; if (!mute) message.Add("Your senses seem clearer."); break; case "sleep": status_paralyzed = (byte)e.magnitude; if (!mute) message.Add("shhh only dreams now"); break; case "speed": speedy = e.magnitude; speed *= (byte)(1 + (e.magnitude / 100)); //Percentage boost if (!mute) message.Add("You feel much faster."); break; } }
public void Affect(Effect e, Level currentLevel) { Affect(e, currentLevel, false); //No mute }
public Effect(Effect e) { this.magnitude = e.magnitude; this.type = e.type; }
public bool visible = false; //You can't see it yet #endregion Fields #region Constructors public Trap(Effect effect) : base("trap", 94, Color.Red) { this.effect = effect; }