MCPcopy Create free account
hub / github.com/EasyRPG/Player / Actor

Method Actor

src/game_interpreter_control_variables.cpp:60–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60int ControlVariables::Actor(int op, int actor_id) {
61 auto actor = Main_Data::game_actors->GetActor(actor_id);
62
63 if (!actor) {
64 Output::Warning("ControlVariables::Actor: Bad actor_id {}", actor_id);
65 return 0;
66 }
67
68 switch (op) {
69 case 0:
70 // Level
71 return actor->GetLevel();
72 break;
73 case 1:
74 // Experience
75 return actor->GetExp();
76 break;
77 case 2:
78 // Current HP
79 return actor->GetHp();
80 break;
81 case 3:
82 // Current MP
83 return actor->GetSp();
84 break;
85 case 4:
86 // Max HP
87 return actor->GetMaxHp();
88 break;
89 case 5:
90 // Max MP
91 return actor->GetMaxSp();
92 break;
93 case 6:
94 // Attack
95 return actor->GetAtk();
96 break;
97 case 7:
98 // Defense
99 return actor->GetDef();
100 break;
101 case 8:
102 // Intelligence
103 return actor->GetSpi();
104 break;
105 case 9:
106 // Agility
107 return actor->GetAgi();
108 break;
109 case 10:
110 // Weapon ID
111 return actor->GetWeaponId();
112 break;
113 case 11:
114 // Shield ID
115 return actor->GetShieldId();
116 break;
117 case 12:

Callers

nothing calls this directly

Calls 15

GetLevelMethod · 0.80
GetMaxHpMethod · 0.80
GetMaxSpMethod · 0.80
GetAtkMethod · 0.80
GetDefMethod · 0.80
GetSpiMethod · 0.80
GetAgiMethod · 0.80
GetWeaponIdMethod · 0.80
GetShieldIdMethod · 0.80
GetArmorIdMethod · 0.80
GetHelmetIdMethod · 0.80
GetAccessoryIdMethod · 0.80

Tested by

no test coverage detected