public void DecorateOption(ActionButtonNode n) { // Debug.LogError ("HERE!"); n.spriteLabel = IconDispenser.instance.SpriteFromIconName(weapon.IconType); n.label = weapon.Name; if (IsRanged()) { if (weapon.IsThrown()) { n.label += " Throw"; } else { n.label += " Shot"; } } else { n.label += " Swing"; } if (IsRanged()) { n.cornerSpriteLabel = IconDispenser.instance.SpriteFromIconName(IconName.RANGED_ATTACK); } else { n.cornerSpriteLabel = IconDispenser.instance.SpriteFromIconName(IconName.MELEE_ATTACK); } // Debug.LogWarning (GetType () + " didn't override decorate option."); }
public override List <IActionOptionChoice> GetChoicesUnfiltered(Actor actor, Action attack) { //return attack type choices.... List <IActionOptionChoice> ret = new List <IActionOptionChoice>(); GenericWeapon mainhand = actor.CharSheet.MainHand(); Equipment offhand = actor.CharSheet.OffHand(); if (!mainhand.IsRanged()) { ret.Add(new AttackTypeChoice(AttackType.MAINHAND_MELEE, actor.CharSheet.MainHand())); } if (mainhand.IsThrown() || mainhand.IsRanged()) { ret.Add(new AttackTypeChoice(AttackType.MAINHAND_RANGED, actor.CharSheet.MainHand())); } if (offhand != null && offhand is GenericWeapon && !(offhand as GenericWeapon).IsRanged()) { ret.Add(new AttackTypeChoice(AttackType.OFFHAND_MELEE, actor.CharSheet.OffHand() as GenericWeapon)); } if (offhand is GenericWeapon) { GenericWeapon wep = offhand as GenericWeapon; if (wep.IsThrown() || wep.IsRanged()) { ret.Add(new AttackTypeChoice(AttackType.OFFHAND_RANGED, offhand as GenericWeapon)); } } if (ret.Count == 0) { lastReasonForNoChoices = "No weapons available for attacking. Really there should always be an option for fist?"; } return(ret); }