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;
121 return CannotEquip();
127 return CannotEquip();
133 return CannotEquip();
139 return CannotEquip();
145 Msg.
Say(
"tooHeavyToEquip", thing);
164 return thing.category.slot != 44;
173 _ =
slots[t.c_equippedSlot - 1];
191 owner.combatCount = 10;
195 Debug.LogWarning(
"could not equip:" + thing?.ToString() +
"/" + slot?.ToString() +
"/" +
owner);
202 if (slot.
thing !=
null)
204 if (slot.
thing == thing)
211 Unequip(thing, refresh:
false);
221 thing.c_equippedSlot = slot.index + 1;
251 if (thing.
Evalue(656) > 0)
296 for (
int i = 0; i <
slots.Count; i++)
316 if (bodySlot.
thing !=
null)
318 bodySlot.thing.c_equippedSlot = i + 1;
334 if (bodySlot.
thing !=
null)
368 public BodySlot GetSlot(
int elementId,
bool onlyEmpty =
true,
bool secondSlot =
false)
373 if (elementId == slot.
elementId && (!onlyEmpty || slot.
thing ==
null))
375 if (!(secondSlot && flag))
501 AttackStyle.TwoHand => 130,
502 AttackStyle.TwoWield => 131,
509 return -(slot.element.sort * 100 +
owner.
body.
slots.IndexOf(slot));
537 t.SetActive(enable:
true);
541 t.SetActive(enable:
false);
SourceElement.Row element
ElementContainerCard elements
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
virtual void SetBlessedState(BlessedState s)
BlessedState blessedState
int ChildrenAndSelfWeight
SourceCategory.Row category
bool HasElement(int ele, bool includeNagative=false)
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)
bool HasElement(int idEle)
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)