public void UpdateOnEquip(MagicItemType from, MagicItemType to) { switch (from) { case MagicItemType.RING_OF_RESISTANCE: attrs[AttrType.RESIST_FIRE]--; attrs[AttrType.RESIST_COLD]--; attrs[AttrType.RESIST_ELECTRICITY]--; break; } switch (to) { case MagicItemType.RING_OF_RESISTANCE: attrs[AttrType.RESIST_FIRE]++; attrs[AttrType.RESIST_COLD]++; attrs[AttrType.RESIST_ELECTRICITY]++; if (HasAttr(AttrType.ON_FIRE) || HasAttr(AttrType.CATCHING_FIRE) || HasAttr(AttrType.STARTED_CATCHING_FIRE_THIS_TURN)) { B.Add("You are no longer on fire. "); int oldradius = LightRadius(); attrs[AttrType.ON_FIRE] = 0; attrs[AttrType.CATCHING_FIRE] = 0; attrs[AttrType.STARTED_CATCHING_FIRE_THIS_TURN] = 0; if (oldradius != LightRadius()) { UpdateRadius(oldradius, LightRadius()); } } break; } }
public static string Name(MagicItemType type){ switch(type){ case MagicItemType.PENDANT_OF_LIFE: return "pendant of life"; case MagicItemType.RING_OF_PROTECTION: return "ring of protection"; case MagicItemType.RING_OF_RESISTANCE: return "ring of resistance"; case MagicItemType.CLOAK_OF_DISAPPEARANCE: return "cloak of disappearance"; default: return "no item"; } }
public static string[] Description(MagicItemType type){ switch(type){ case MagicItemType.PENDANT_OF_LIFE: return new string[]{"Pendant of life -- Prevents a lethal attack from","finishing you, but only works once."}; case MagicItemType.RING_OF_PROTECTION: return new string[]{"Ring of protection -- Grants a small bonus to","defense."}; case MagicItemType.RING_OF_RESISTANCE: return new string[]{"Ring of resistance -- Grants resistance to cold,","fire, and electricity."}; case MagicItemType.CLOAK_OF_DISAPPEARANCE: return new string[]{"Cloak of disappearance -- When your health falls,","gives you a chance to escape to safety."}; default: return new string[]{"no","item"}; } }
public static cstr StatsName(MagicItemType type){ cstr cs = new cstr("", Color.Gray, Color.Black); cs.bgcolor = Color.Black; cs.color = Color.DarkGreen; switch(type){ case MagicItemType.RING_OF_PROTECTION: cs.s = "Ring (prot)"; break; case MagicItemType.RING_OF_RESISTANCE: cs.s = "Ring (res)"; break; case MagicItemType.PENDANT_OF_LIFE: cs.s = "Pendant"; break; case MagicItemType.CLOAK_OF_DISAPPEARANCE: cs.s = "Cloak"; break; default: cs.s = "No item"; break; } return cs; }