MCPcopy Create free account
hub / github.com/TurningWheel/Barony / followerDebugEquipment

Function followerDebugEquipment

src/actplayer.cpp:5072–5338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5070}
5071
5072void followerDebugEquipment(int player)
5073{
5074 static ConsoleVariable<bool> cvar_followerdebugequipment("/followerdebugequipment", false);
5075 Entity* follower = nullptr;
5076 if ( *cvar_followerdebugequipment && (svFlags & SV_FLAG_CHEATS) )
5077 {
5078 for ( node_t* node = stats[player]->FOLLOWERS.first; node != nullptr; node = node->next )
5079 {
5080 Uint32* c = (Uint32*)node->element;
5081 if ( c )
5082 {
5083 follower = uidToEntity(*c);
5084 break;
5085 }
5086 }
5087 }
5088
5089 if ( follower )
5090 {
5091 Stat* stats = follower->getStats();
5092 follower->setEffect(EFF_STUNNED, true, 50, false);
5093
5094 follower->flags[USERFLAG2] = false;
5095 for ( auto bodypart : follower->bodyparts )
5096 {
5097 bodypart->flags[USERFLAG2] = false;
5098 }
5099
5100 if ( keystatus[SDLK_F3] )
5101 {
5102 keystatus[SDLK_F3] = 0;
5103 if ( stats->sex == MALE )
5104 {
5105 stats->sex = FEMALE;
5106 }
5107 else
5108 {
5109 stats->sex = MALE;
5110 }
5111 }
5112
5113 if ( keystatus[SDLK_1] )
5114 {
5115 Input::inputs[player].refresh();
5116 keystatus[SDLK_1] = 0;
5117 if ( keystatus[SDLK_LALT] || keystatus[SDLK_RALT] )
5118 {
5119 if ( stats->helmet )
5120 {
5121 list_RemoveNode(stats->helmet->node);
5122 stats->helmet = nullptr;
5123 }
5124 }
5125 else
5126 {
5127 if ( !stats->helmet )
5128 {
5129 stats->helmet = newItem(LEATHER_HELM, EXCELLENT, 0, 1, local_rng.rand(), true, &stats->inventory);

Callers 1

actPlayerFunction · 0.85

Calls 8

list_RemoveNodeFunction · 0.85
statueCycleItemFunction · 0.85
setEffectMethod · 0.80
refreshMethod · 0.80
randMethod · 0.80
uidToEntityFunction · 0.70
newItemFunction · 0.70
getStatsMethod · 0.45

Tested by

no test coverage detected