1using System.Collections.Generic;
8 public List<BodySlot>
slots =
new List<BodySlot>();
27 for (
int i = 0; i <
rawSlots.Length; i++)
36 int num = thing.c_equippedSlot - 1;
37 if (num < 0 || num >=
slots.Count)
39 thing.c_equippedSlot = 0;
42 slots[num].thing = thing;
70 if (slot.
thing ==
null)
81 thing.c_equippedSlot = 0;
117 return CannotEquip();
123 return CannotEquip();
129 return CannotEquip();
135 return CannotEquip();
141 Msg.
Say(
"tooHeavyToEquip", thing);
160 return thing.category.slot != 44;
169 _ =
slots[t.c_equippedSlot - 1];
187 owner.combatCount = 10;
191 Debug.LogWarning(
"could not equip:" + thing?.ToString() +
"/" + slot?.ToString() +
"/" +
owner);
198 if (slot.
thing !=
null)
200 if (slot.
thing == thing)
207 Unequip(thing, refresh:
false);
217 thing.c_equippedSlot = slot.index + 1;
244 if (thing.
Evalue(656) > 0)
321 if (bodySlot.
thing !=
null)
355 public BodySlot GetSlot(
int elementId,
bool onlyEmpty =
true,
bool secondSlot =
false)
360 if (elementId == slot.
elementId && (!onlyEmpty || slot.
thing ==
null))
362 if (!(secondSlot && flag))
464 AttackStyle.TwoHand => 130,
465 AttackStyle.TwoWield => 131,
472 return -(slot.element.sort * 100 +
owner.
body.
slots.IndexOf(slot));
500 t.SetActive(enable:
true);
504 t.SetActive(enable:
false);
SourceElement.Row element
ElementContainerCard elements
bool HasElement(int ele, int req=1)
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
BlessedState blessedState
int ChildrenAndSelfWeight
SourceCategory.Row category
void Say(string lang, string ref1=null, string ref2=null)
void RemoveBodyPartAt(int idx)
BodySlot GetSlot(int elementId, bool onlyEmpty=true, bool secondSlot=false)
void SetOwner(Chara chara, bool deserialized=false)
void AddBodyPart(int ele, Thing thing=null)
void UnequipAll(int idSlot)
void UnqeuipIfTooHeavy(Thing t)
void Unequip(Thing thing, bool refresh=true)
int GetAttackIndex(Thing t)
void Unequip(BodySlot slot, bool refresh=true)
bool IsTooHeavyToEquip(Thing thing)
void SetBodyIndexText(BodySlot b, UIText t)
AttackStyle GetAttackStyle()
int GetAttackStyleElement(AttackStyle style)
int GetSortVal(BodySlot slot)
bool IsEquippable(Thing thing, BodySlot slot, bool text=true)
int GetWeight(bool armorOnly=false)
Thing GetEquippedThing(int elementId)
bool Equip(Thing thing, BodySlot slot=null, bool msg=true)
BodySlot GetSlot(Thing t, bool onlyEmpty=false, bool secondSlot=false)
void RemoveBodyPart(int ele)
void Refresh(bool calledRecursive=false)
void SetTempHand(int right=0, int left=0)
bool TryEquip(Thing t, bool useFav=false)
void OnUnequip(Chara c, Thing t)
void OnEquip(Chara c, Thing t)
ElementContainerFaction charaElements
static void SetDirty(Thing t)
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
virtual void OnEquip(Chara c, bool onSetOwner)
virtual void OnUnequip(Chara c)