static WeaponHitClass() { map.Add("hth", new WeaponHitClass() { sound = SoundInfo.Find("weapon_punch_1"), hitSound = SoundInfo.Find("impact_punch_1") }); map.Add("1hss", new WeaponHitClass() { sound = SoundInfo.Find("weapon_1hs_small_1"), hitSound = SoundInfo.Find("impact_blade_swing_1") }); map.Add("1hsl", new WeaponHitClass() { sound = SoundInfo.Find("weapon_1hs_large_1"), hitSound = SoundInfo.Find("impact_blade_swing_1") }); map.Add("2hss", new WeaponHitClass() { sound = SoundInfo.Find("weapon_2hs_small_1"), hitSound = SoundInfo.Find("impact_blade_swing_1") }); map.Add("2hsl", new WeaponHitClass() { sound = SoundInfo.Find("weapon_2hs_large_1"), hitSound = SoundInfo.Find("impact_blade_swing_1") }); map.Add("1ht", new WeaponHitClass() { sound = SoundInfo.Find("weapon_1ht_1"), hitSound = SoundInfo.Find("impact_blade_thrust_1") }); map.Add("2ht", new WeaponHitClass() { sound = SoundInfo.Find("weapon_2ht_1"), hitSound = SoundInfo.Find("impact_blade_thrust_1") }); map.Add("club", new WeaponHitClass() { sound = SoundInfo.Find("weapon_1ht_1"), hitSound = SoundInfo.Find("impact_blunt_1") }); map.Add("staf", new WeaponHitClass() { sound = SoundInfo.Find("weapon_staff_1"), hitSound = SoundInfo.Find("impact_blunt_1") }); map.Add("bow", new WeaponHitClass() { sound = null, hitSound = null }); map.Add("xbow", new WeaponHitClass() { sound = null, hitSound = null }); map.Add("claw", new WeaponHitClass() { sound = SoundInfo.Find("weapon_punch_1"), hitSound = SoundInfo.Find("impact_claw_1") }); foreach (var kv in map) { kv.Value.code = kv.Key; } HandToHand = map["hth"]; }
public void Use(MiscInfo itemInfo) { Debug.Log("Use item " + itemInfo.name + ", function: " + itemInfo.useFunction); switch (itemInfo.useFunction) { case MiscInfo.UseFunction.None: break; case MiscInfo.UseFunction.IdentifyItem: break; case MiscInfo.UseFunction.TownPortal: var pos = Iso.MapToWorld(iso.pos); var teleport = World.SpawnObject("TP", pos, fit: true); teleport.modeName = "OP"; var sound = SoundInfo.Find("player_townportal_cast"); AudioManager.instance.Play(sound, pos); break; case MiscInfo.UseFunction.Potion: if (itemInfo.stat1 == "hpregen") { character.health += itemInfo.calc1; } if (itemInfo.stat1 == "manarecovery") { character.mana += itemInfo.calc1; } break; case MiscInfo.UseFunction.RejuvPotion: if (itemInfo.stat1 == "hitpoints") { character.health += (int)(itemInfo.calc1 / 100.0f * character.maxHealth); } if (itemInfo.stat1 == "mana") { character.mana += (int)(itemInfo.calc1 / 100.0f * character.maxMana); } if (itemInfo.stat2 == "hitpoints") { character.health += (int)(itemInfo.calc2 / 100.0f * character.maxHealth); } if (itemInfo.stat2 == "mana") { character.mana += (int)(itemInfo.calc2 / 100.0f * character.maxMana); } break; case MiscInfo.UseFunction.TemporaryPotion: break; case MiscInfo.UseFunction.HoradricCube: break; case MiscInfo.UseFunction.Elixir: break; case MiscInfo.UseFunction.StaminaPotion: break; } }
private void Awake() { selectSound = SoundInfo.Find("cursor_pass"); }