Elin Decompiled Documentation EA 23.130 Nightly
Loading...
Searching...
No Matches
CharaBody Class Reference
Inheritance diagram for CharaBody:
EClass

Public Member Functions

void SetOwner (Chara chara, bool deserialized=false)
 
void Unequip (Thing thing, bool refresh=true)
 
void UnequipAll (int idSlot)
 
void Unequip (BodySlot slot, bool refresh=true)
 
bool IsEquippable (Thing thing, BodySlot slot, bool text=true)
 
bool IsTooHeavyToEquip (Thing thing)
 
void UnqeuipIfTooHeavy (Thing t)
 
bool Equip (Thing thing, BodySlot slot=null, bool msg=true)
 
void AddBodyPart (int ele, Thing thing=null)
 
void RefreshBodyParts ()
 
void RemoveBodyPart (int ele)
 
void RemoveBodyPartAt (int idx)
 
BodySlot GetSlot (Thing t, bool onlyEmpty=false, bool secondSlot=false)
 
BodySlot GetSlot (int elementId, bool onlyEmpty=true, bool secondSlot=false)
 
Thing GetEquippedThing (int elementId)
 
int GetWeight (bool armorOnly=false)
 
int GetAttackIndex (Thing t)
 
int GetMeleeDistance ()
 
AttackStyle GetAttackStyle ()
 
int GetAttackStyleElement (AttackStyle style)
 
int GetSortVal (BodySlot slot)
 
void SetBodyIndexText (BodySlot b, UIText t)
 

Public Attributes

Chara owner
 
List< BodySlotslots = new List<BodySlot>()
 
BodySlot slotMainHand
 
BodySlot slotOffHand
 
BodySlot slotRange
 

Properties

int[] rawSlots [get]
 
- Properties inherited from EClass
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Faction Wilds [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 

Additional Inherited Members

- Static Public Member Functions inherited from EClass
static int rndSeed (int a, int seed)
 
static int rnd (int a)
 
static int curve (int a, int start, int step, int rate=75)
 
static int rndHalf (int a)
 
static float rndf (float a)
 
static int rndSqrt (int a)
 
static void Wait (float a, Card c)
 
static void Wait (float a, Point p)
 
static int Bigger (int a, int b)
 
static int Smaller (int a, int b)
 
- Static Public Attributes inherited from EClass
static Core core
 

Detailed Description

Definition at line 4 of file CharaBody.cs.

Member Function Documentation

◆ AddBodyPart()

void CharaBody.AddBodyPart ( int  ele,
Thing  thing = null 
)
inline

Definition at line 261 of file CharaBody.cs.

262 {
264 {
265 elementId = ele,
266 thing = thing,
267 index = slots.Count
268 };
269 if (ele == 35)
270 {
271 if (slotMainHand == null)
272 {
274 }
275 else if (slotOffHand == null)
276 {
278 }
279 }
280 if (ele == 41)
281 {
282 slotRange = item;
283 }
284 slots.Add(item);
285 }
BodySlot slotOffHand
Definition: CharaBody.cs:12
List< BodySlot > slots
Definition: CharaBody.cs:8
BodySlot slotMainHand
Definition: CharaBody.cs:10
BodySlot slotRange
Definition: CharaBody.cs:14

References item, slotMainHand, slotOffHand, slotRange, and slots.

Referenced by Chara.AddRandomBodyPart(), DNA.Apply(), Chara.ApplyRace(), CoreDebug.ChangeRace(), Player.CreateEquip(), Chara.ResetBody(), and SetOwner().

◆ Equip()

bool CharaBody.Equip ( Thing  thing,
BodySlot  slot = null,
bool  msg = true 
)
inline

Definition at line 182 of file CharaBody.cs.

183 {
184 slot = slot ?? GetSlot(thing.category.slot) ?? GetSlot(thing.category.slot, onlyEmpty: false);
185 if (slot == slotMainHand || slot == slotOffHand)
186 {
187 owner.combatCount = 10;
188 }
189 if (slot == null || slot.elementId != thing.category.slot)
190 {
191 Debug.LogWarning("could not equip:" + thing?.ToString() + "/" + slot?.ToString() + "/" + owner);
192 return false;
193 }
194 if (!IsEquippable(thing, slot))
195 {
196 return false;
197 }
198 if (slot.thing != null)
199 {
200 if (slot.thing == thing)
201 {
202 Unequip(slot);
203 return false;
204 }
205 Unequip(slot, refresh: false);
206 }
207 Unequip(thing, refresh: false);
208 if (thing.parent != owner)
209 {
210 if (msg && owner.IsPC && thing.parent is Thing)
211 {
212 Msg.Say("movedToEquip", thing, thing.parent as Thing);
213 }
214 owner.AddCard(thing);
215 }
216 slot.thing = thing;
217 thing.c_equippedSlot = slot.index + 1;
218 thing.elements.SetParent(owner);
219 thing.trait.OnEquip(owner, onSetOwner: false);
220 if (EClass.pc != null)
221 {
223 }
225 if (owner.IsPC)
226 {
227 if (msg)
228 {
230 }
233 }
234 if (slot.elementId == 45 && EClass.core.IsGameStarted)
235 {
237 }
239 {
240 owner.Refresh();
241 }
242 if (owner.isCreated)
243 {
244 if (thing.Evalue(656) > 0)
245 {
246 thing.blessedState = BlessedState.Cursed;
247 }
248 if (thing.blessedState <= BlessedState.Cursed)
249 {
250 owner.Say("equipCursed", owner);
251 owner.PlaySound("curse3");
252 }
253 }
254 if (slot.elementId == 37 && owner.HasElement(1209))
255 {
256 owner.Say("tail_covered", owner);
257 }
258 return true;
259 }
BlessedState
Definition: BlessedState.cs:2
int elementId
Definition: BodySlot.cs:6
Thing thing
Definition: BodySlot.cs:8
ElementContainerCard elements
Definition: Card.cs:37
bool HasElement(int ele, int req=1)
Definition: Card.cs:5395
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:5585
Card AddCard(Card c)
Definition: Card.cs:2936
ICardParent parent
Definition: Card.cs:51
void RecalculateFOV()
Definition: Card.cs:5797
Trait trait
Definition: Card.cs:49
int Evalue(int ele)
Definition: Card.cs:2471
BlessedState blessedState
Definition: Card.cs:262
SourceCategory.Row category
Definition: Card.cs:1949
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:6232
Chara owner
Definition: CharaBody.cs:6
void Unequip(Thing thing, bool refresh=true)
Definition: CharaBody.cs:49
bool IsEquippable(Thing thing, BodySlot slot, bool text=true)
Definition: CharaBody.cs:106
BodySlot GetSlot(Thing t, bool onlyEmpty=false, bool secondSlot=false)
Definition: CharaBody.cs:347
void Refresh(bool calledRecursive=false)
Definition: Chara.cs:1518
Faction faction
Definition: Chara.cs:417
override bool IsPC
Definition: Chara.cs:602
bool isCreated
Definition: Chara.cs:134
void SetTempHand(int right=0, int left=0)
Definition: Chara.cs:6115
bool IsGameStarted
Definition: Core.cs:84
Definition: EClass.cs:5
static Core core
Definition: EClass.cs:6
static Chara pc
Definition: EClass.cs:14
void OnEquip(Chara c, Thing t)
void SetParent(Card c)
ElementContainerFaction charaElements
Definition: FACTION.cs:144
static void Refresh()
Definition: LayerChara.cs:16
static void SetDirty(Thing t)
Definition: Msg.cs:5
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
Definition: Thing.cs:8
virtual void OnEquip(Chara c, bool onSetOwner)
Definition: Trait.cs:660
static void SetDirty()
Definition: WidgetEquip.cs:34

References Card.AddCard(), Card.blessedState, Card.category, Faction.charaElements, EClass.core, Debug, BodySlot.elementId, Card.elements, Card.Evalue(), Chara.faction, GetSlot(), Card.HasElement(), Chara.isCreated, IsEquippable(), Core.IsGameStarted, Chara.IsPC, Trait.OnEquip(), ElementContainerFaction.OnEquip(), owner, Card.parent, EClass.pc, Card.PlaySound(), Card.RecalculateFOV(), LayerChara.Refresh(), Chara.Refresh(), Msg.Say(), Card.Say(), WidgetEquip.SetDirty(), LayerInventory.SetDirty(), ElementContainer.SetParent(), Chara.SetTempHand(), slotMainHand, slotOffHand, BodySlot.thing, Card.trait, and Unequip().

Referenced by CoreDebug.ChangeRace(), Chara.EQ_CAT(), Chara.EQ_ID(), InvOwner.ListInteractions(), InvOwner.OnDrag(), TraitMannequin.OnUse(), HotItemEQSet.Perform(), InvOwner.PutBack(), AI_Equip.Run(), and Chara.TryEquip().

◆ GetAttackIndex()

int CharaBody.GetAttackIndex ( Thing  t)
inline

Definition at line 403 of file CharaBody.cs.

404 {
405 int num = 0;
406 foreach (BodySlot slot in slots)
407 {
408 if (slot.thing != null && slot.elementId == 35 && slot.thing.source.offense.Length >= 2)
409 {
410 if (slot.thing == t)
411 {
412 return num;
413 }
414 num++;
415 }
416 }
417 return -1;
418 }
SourceThing.Row source
Definition: Thing.cs:11

References BodySlot.elementId, slots, Thing.source, and BodySlot.thing.

◆ GetAttackStyle()

AttackStyle CharaBody.GetAttackStyle ( )
inline

Definition at line 433 of file CharaBody.cs.

434 {
435 bool flag = false;
436 int num = 0;
437 foreach (BodySlot slot in slots)
438 {
439 if (slot.elementId == 35 && slot.thing != null)
440 {
441 if (slot.thing.IsMeleeWeapon)
442 {
443 num++;
444 }
445 else
446 {
447 flag = true;
448 }
449 }
450 }
451 if (num > 1)
452 {
453 return AttackStyle.TwoWield;
454 }
455 if (flag)
456 {
457 return AttackStyle.Shield;
458 }
459 if (num == 1)
460 {
461 return AttackStyle.TwoHand;
462 }
463 return AttackStyle.Default;
464 }
AttackStyle
Definition: AttackStyle.cs:2
bool IsMeleeWeapon
Definition: Card.cs:2141

References BodySlot.elementId, Card.IsMeleeWeapon, slots, and BodySlot.thing.

Referenced by Chara.CalcCastingChance(), Card.DamageHP(), AttackProcess.Prepare(), WindowCharaMini.Refresh(), and WindowChara.RefreshProfile().

◆ GetAttackStyleElement()

int CharaBody.GetAttackStyleElement ( AttackStyle  style)
inline

Definition at line 466 of file CharaBody.cs.

467 {
468 return style switch
469 {
470 AttackStyle.TwoHand => 130,
471 AttackStyle.TwoWield => 131,
472 _ => 0,
473 };
474 }

Referenced by AttackProcess.Perform().

◆ GetEquippedThing()

Thing CharaBody.GetEquippedThing ( int  elementId)
inline

Definition at line 378 of file CharaBody.cs.

379 {
380 foreach (BodySlot slot in slots)
381 {
382 if (slot.elementId == elementId && slot.thing != null)
383 {
384 return slot.thing;
385 }
386 }
387 return null;
388 }

References BodySlot.elementId, slots, and BodySlot.thing.

Referenced by QuestCrafter.CanUpdateOnTalk(), Card.GetLightRadius(), and CoreDebug.QuickStart().

◆ GetMeleeDistance()

int CharaBody.GetMeleeDistance ( )
inline

Definition at line 420 of file CharaBody.cs.

421 {
422 int num = owner.Evalue(666);
423 foreach (BodySlot slot in slots)
424 {
425 if (slot.elementId == 35 && slot.thing != null && slot.thing.Evalue(666) > num)
426 {
427 num = slot.thing.Evalue(666);
428 }
429 }
430 return 1 + num;
431 }

References BodySlot.elementId, Card.Evalue(), owner, slots, and BodySlot.thing.

Referenced by GoalCombat.TryUseAbility().

◆ GetSlot() [1/2]

BodySlot CharaBody.GetSlot ( int  elementId,
bool  onlyEmpty = true,
bool  secondSlot = false 
)
inline

Definition at line 361 of file CharaBody.cs.

362 {
363 bool flag = true;
364 foreach (BodySlot slot in slots)
365 {
366 if (elementId == slot.elementId && (!onlyEmpty || slot.thing == null))
367 {
368 if (!(secondSlot && flag))
369 {
370 return slot;
371 }
372 flag = false;
373 }
374 }
375 return null;
376 }

References BodySlot.elementId, slots, and BodySlot.thing.

◆ GetSlot() [2/2]

BodySlot CharaBody.GetSlot ( Thing  t,
bool  onlyEmpty = false,
bool  secondSlot = false 
)
inline

Definition at line 347 of file CharaBody.cs.

348 {
349 BodySlot slot = GetSlot(t.category.slot, onlyEmpty: true, secondSlot);
350 if (slot != null)
351 {
352 return slot;
353 }
354 if (!onlyEmpty)
355 {
356 return GetSlot(t.category.slot, onlyEmpty: false, secondSlot);
357 }
358 return null;
359 }

References Card.category, and GetSlot().

Referenced by Chara.EQ_CAT(), Chara.EQ_ID(), Equip(), GetSlot(), InvOwner.ListInteractions(), HotItemEQSet.Perform(), Chara.RefreshSpeed(), Chara.ShouldEquip(), and Chara.TryEquip().

◆ GetSortVal()

int CharaBody.GetSortVal ( BodySlot  slot)
inline

Definition at line 476 of file CharaBody.cs.

477 {
478 return -(slot.element.sort * 100 + owner.body.slots.IndexOf(slot));
479 }
CharaBody body
Definition: Chara.cs:94

References Chara.body, owner, and slots.

Referenced by LayerEquip.RefreshEquipment(), WidgetEquip.RefreshEquipment(), WindowChara.RefreshEquipment(), and ButtonElement.SetGrid().

◆ GetWeight()

int CharaBody.GetWeight ( bool  armorOnly = false)
inline

Definition at line 390 of file CharaBody.cs.

391 {
392 int num = 0;
393 foreach (BodySlot slot in slots)
394 {
395 if (slot.thing != null && (!armorOnly || (slot.elementId != 44 && slot.elementId != 45)))
396 {
397 num += slot.thing.ChildrenAndSelfWeight;
398 }
399 }
400 return num;
401 }
int ChildrenAndSelfWeight
Definition: Card.cs:1941

References Card.ChildrenAndSelfWeight, BodySlot.elementId, slots, and BodySlot.thing.

Referenced by Chara.GetArmorSkill(), WindowCharaMini.Refresh(), and WindowChara.RefreshProfile().

◆ IsEquippable()

bool CharaBody.IsEquippable ( Thing  thing,
BodySlot  slot,
bool  text = true 
)
inline

Definition at line 106 of file CharaBody.cs.

107 {
108 if (slot == null)
109 {
110 return false;
111 }
112 switch (slot.elementId)
113 {
114 case 31:
115 if (owner.HasElement(1555))
116 {
117 return CannotEquip();
118 }
119 break;
120 case 33:
121 if (owner.HasElement(1554))
122 {
123 return CannotEquip();
124 }
125 break;
126 case 39:
127 if (owner.HasElement(1552))
128 {
129 return CannotEquip();
130 }
131 break;
132 }
133 if (slot.thing != null && slot.thing.blessedState <= BlessedState.Cursed)
134 {
135 return CannotEquip();
136 }
137 if (IsTooHeavyToEquip(thing))
138 {
139 if (EClass.core.IsGameStarted && owner.IsPC && text)
140 {
141 Msg.Say("tooHeavyToEquip", thing);
142 }
143 return false;
144 }
145 return true;
146 bool CannotEquip()
147 {
148 if (text)
149 {
150 Msg.Say("cannnotEquip", slot.element.GetName().ToLower());
151 }
152 return false;
153 }
154 }
SourceElement.Row element
Definition: BodySlot.cs:16
bool IsTooHeavyToEquip(Thing thing)
Definition: CharaBody.cs:156

References Card.blessedState, EClass.core, BodySlot.element, BodySlot.elementId, Card.HasElement(), Core.IsGameStarted, Chara.IsPC, IsTooHeavyToEquip(), owner, Msg.Say(), and BodySlot.thing.

Referenced by Equip(), InvOwner.OnDrag(), and Chara.ShouldEquip().

◆ IsTooHeavyToEquip()

bool CharaBody.IsTooHeavyToEquip ( Thing  thing)
inline

Definition at line 156 of file CharaBody.cs.

157 {
158 if (owner.HasElement(1204) && thing.ChildrenAndSelfWeight > 1000)
159 {
160 return thing.category.slot != 44;
161 }
162 return false;
163 }

References Card.ChildrenAndSelfWeight, Card.HasElement(), and owner.

Referenced by Thing.CanAutoFire(), Chara.CanEquipRanged(), IsEquippable(), ActRanged.Perform(), and UnqeuipIfTooHeavy().

◆ RefreshBodyParts()

void CharaBody.RefreshBodyParts ( )
inline

Definition at line 287 of file CharaBody.cs.

288 {
289 for (int i = 0; i < slots.Count; i++)
290 {
291 BodySlot bodySlot = slots[i];
292 bodySlot.index = i;
293 int elementId = bodySlot.elementId;
294 if (elementId == 35)
295 {
296 if (slotMainHand == null)
297 {
298 slotMainHand = bodySlot;
299 }
300 else if (slotOffHand == null)
301 {
302 slotOffHand = bodySlot;
303 }
304 }
305 if (elementId == 41)
306 {
307 slotRange = bodySlot;
308 }
309 if (bodySlot.thing != null)
310 {
311 bodySlot.thing.c_equippedSlot = i + 1;
312 }
313 }
314 }

References BodySlot.elementId, slotMainHand, slotOffHand, slotRange, slots, and BodySlot.thing.

Referenced by DNA.Apply(), Chara.ApplyRace(), and Chara.ResetBody().

◆ RemoveBodyPart()

void CharaBody.RemoveBodyPart ( int  ele)
inline

Definition at line 316 of file CharaBody.cs.

317 {
318 int idx = slots.FindIndex((BodySlot a) => a.elementId == ele);
319 RemoveBodyPartAt(idx);
320 }
void RemoveBodyPartAt(int idx)
Definition: CharaBody.cs:322

References BodySlot.elementId, RemoveBodyPartAt(), and slots.

Referenced by DNA.Apply(), Chara.ApplyRace(), CoreDebug.ChangeRace(), and Chara.ResetBody().

◆ RemoveBodyPartAt()

void CharaBody.RemoveBodyPartAt ( int  idx)
inline

Definition at line 322 of file CharaBody.cs.

323 {
324 if (idx != -1)
325 {
326 BodySlot bodySlot = slots[idx];
327 if (bodySlot.thing != null)
328 {
329 Unequip(bodySlot);
330 }
331 if (slotMainHand == bodySlot)
332 {
333 slotMainHand = null;
334 }
335 if (slotOffHand == bodySlot)
336 {
337 slotOffHand = null;
338 }
339 if (slotRange == bodySlot)
340 {
341 slotRange = null;
342 }
343 slots.RemoveAt(idx);
344 }
345 }

References slotMainHand, slotOffHand, slotRange, slots, BodySlot.thing, and Unequip().

Referenced by RemoveBodyPart(), and Chara.RemoveLastBodyPart().

◆ SetBodyIndexText()

void CharaBody.SetBodyIndexText ( BodySlot  b,
UIText  t 
)
inline

Definition at line 481 of file CharaBody.cs.

482 {
483 if (!t)
484 {
485 return;
486 }
487 if (b.indexPart == 0)
488 {
489 int num = 0;
490 foreach (BodySlot slot in slots)
491 {
492 if (slot.elementId == b.element.id)
493 {
494 num++;
495 }
496 if (b == slot)
497 {
498 break;
499 }
500 }
501 b.indexPart = num;
502 }
503 if (b.elementId == 35)
504 {
505 t.SetText(b.indexPart.ToString() ?? "");
506 t.SetActive(enable: true);
507 }
508 else
509 {
510 t.SetActive(enable: false);
511 }
512 }
int indexPart
Definition: BodySlot.cs:12
void SetText(string s)
Definition: UIText.cs:159

References BodySlot.element, BodySlot.elementId, BodySlot.indexPart, UIText.SetText(), and slots.

Referenced by ButtonGrid.SetBodySlot().

◆ SetOwner()

void CharaBody.SetOwner ( Chara  chara,
bool  deserialized = false 
)
inline

Definition at line 18 of file CharaBody.cs.

19 {
20 owner = chara;
21 if (!deserialized)
22 {
23 return;
24 }
25 if (rawSlots != null)
26 {
27 for (int i = 0; i < rawSlots.Length; i++)
28 {
30 }
31 }
32 foreach (Thing thing in owner.things)
33 {
34 if (thing.isEquipped)
35 {
36 int num = thing.c_equippedSlot - 1;
37 if (num < 0 || num >= slots.Count)
38 {
39 thing.c_equippedSlot = 0;
40 continue;
41 }
42 slots[num].thing = thing;
44 thing.trait.OnEquip(owner, onSetOwner: true);
45 }
46 }
47 }
ThingContainer things
Definition: Card.cs:34
void AddBodyPart(int ele, Thing thing=null)
Definition: CharaBody.cs:261
int[] rawSlots
Definition: CharaBody.cs:16
bool isEquipped
Definition: Thing.cs:17

References AddBodyPart(), Card.elements, Thing.isEquipped, Trait.OnEquip(), owner, rawSlots, ElementContainer.SetParent(), slots, Card.things, and Card.trait.

Referenced by Chara.OnCreate(), and Chara.OnDeserialized().

◆ Unequip() [1/2]

void CharaBody.Unequip ( BodySlot  slot,
bool  refresh = true 
)
inline

Definition at line 68 of file CharaBody.cs.

69 {
70 if (slot.thing == null)
71 {
72 return;
73 }
74 Thing thing = slot.thing;
75 if (EClass.pc != null)
76 {
78 }
79 thing.elements.SetParent();
80 thing.trait.OnUnequip(owner);
81 thing.c_equippedSlot = 0;
82 slot.thing = null;
83 if (owner.IsPC)
84 {
85 if (refresh)
86 {
88 }
90 }
92 if (slot.elementId == 45 && EClass.core.IsGameStarted)
93 {
95 }
96 if (refresh && owner.isCreated && EClass.core.IsGameStarted)
97 {
98 owner.Refresh();
99 if (slot.elementId == 37 && owner.HasElement(1209))
100 {
101 owner.Say("tail_free", owner);
102 }
103 }
104 }
void OnUnequip(Chara c, Thing t)
virtual void OnUnequip(Chara c)
Definition: Trait.cs:664

References Faction.charaElements, EClass.core, BodySlot.elementId, Card.elements, Chara.faction, Card.HasElement(), Chara.isCreated, Core.IsGameStarted, Chara.IsPC, Trait.OnUnequip(), ElementContainerFaction.OnUnequip(), owner, EClass.pc, Card.RecalculateFOV(), LayerChara.Refresh(), Chara.Refresh(), Card.Say(), WidgetEquip.SetDirty(), LayerInventory.SetDirty(), ElementContainer.SetParent(), BodySlot.thing, and Card.trait.

◆ Unequip() [2/2]

void CharaBody.Unequip ( Thing  thing,
bool  refresh = true 
)
inline

◆ UnequipAll()

void CharaBody.UnequipAll ( int  idSlot)
inline

Definition at line 57 of file CharaBody.cs.

58 {
59 foreach (BodySlot slot in slots)
60 {
61 if (slot.elementId == idSlot)
62 {
63 Unequip(slot);
64 }
65 }
66 }

References BodySlot.elementId, slots, and Unequip().

Referenced by Feat.Apply().

◆ UnqeuipIfTooHeavy()

void CharaBody.UnqeuipIfTooHeavy ( Thing  t)
inline

Definition at line 165 of file CharaBody.cs.

166 {
167 if (t.isEquipped)
168 {
169 _ = slots[t.c_equippedSlot - 1];
170 if (IsTooHeavyToEquip(t))
171 {
172 owner.Say("tooHeavyToEquip", t);
173 Unequip(t);
174 }
175 }
176 if (!owner.IsPC && !t.isEquipped)
177 {
178 owner.TryEquip(t);
179 }
180 }
bool TryEquip(Thing t, bool useFav=false)
Definition: Chara.cs:7058

References Thing.isEquipped, Chara.IsPC, IsTooHeavyToEquip(), owner, Card.Say(), slots, Chara.TryEquip(), and Unequip().

Referenced by ActEffect.Proc().

Member Data Documentation

◆ owner

◆ slotMainHand

◆ slotOffHand

BodySlot CharaBody.slotOffHand

◆ slotRange

BodySlot CharaBody.slotRange

Definition at line 14 of file CharaBody.cs.

Referenced by AddBodyPart(), RefreshBodyParts(), and RemoveBodyPartAt().

◆ slots

Property Documentation

◆ rawSlots

int [] CharaBody.rawSlots
get

Definition at line 16 of file CharaBody.cs.

Referenced by SetOwner().


The documentation for this class was generated from the following file: