static void AddWeaponShortcutsFor(Character player, CarriedWeapon carriedWeapon) { List <PlayerActionShortcut> lastShortcuts = null; List <ItemEffect> weaponEffects = AllWeaponEffects.GetAll(carriedWeapon.Weapon.Name).OrderBy(x => x.index).ToList();; if (weaponEffects.Count == 0) { lastShortcuts = PlayerActionShortcut.FromWeapon(carriedWeapon, null, player); } else { for (int i = 0; i < weaponEffects.Count; i++) { ItemEffect itemEffect = weaponEffects[i]; if (i == 0) { lastShortcuts = PlayerActionShortcut.FromWeapon(carriedWeapon, itemEffect, player); } else { foreach (PlayerActionShortcut playerActionShortcut in lastShortcuts) { playerActionShortcut.Windups.Add(WindupDto.FromItemEffect(itemEffect, PlayerActionShortcut.WeaponWindupPrefix + playerActionShortcut.Name)); } } } } if (lastShortcuts != null) { AllShortcuts.AddRange(lastShortcuts); } }
static void AddSpellShortcutsFor(Character player, KnownSpell knownSpell) { List <PlayerActionShortcut> lastShortcuts = null; List <ItemEffect> spellEffects = AllSpellEffects.GetAll(knownSpell.SpellName).OrderBy(x => x.index).ToList(); if (spellEffects.Count == 0) { lastShortcuts = PlayerActionShortcut.FromItemSpellEffect(knownSpell.SpellName, null, player); } else { for (int i = 0; i < spellEffects.Count; i++) { ItemEffect itemEffect = spellEffects[i]; if (i == 0) { lastShortcuts = PlayerActionShortcut.FromItemSpellEffect(knownSpell.SpellName, itemEffect, player); } else { foreach (PlayerActionShortcut playerActionShortcut in lastShortcuts) { playerActionShortcut.Windups.Add(WindupDto.FromItemEffect(itemEffect, playerActionShortcut.Name)); } } } } if (lastShortcuts != null) { AllShortcuts.AddRange(lastShortcuts); } }