File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed
Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ #include "game/protos/economy.h"
2+ #include "game/scenes/mechlab/lab_har_constants.h"
3+
4+ /* WIP: Put in correct formula */
5+ void update_total_value (sd_pilot * pilot ) {
6+ int value = har_prices [pilot -> har_id ];
7+ for (int i = 1 ; i < pilot -> arm_power ; i ++ ) {
8+ value += har_upgrade_price [pilot -> har_id ] * upgrade_level_multiplier [i ] * arm_leg_multiplier ;
9+ }
10+
11+ for (int i = 1 ; i < pilot -> leg_power ; i ++ ) {
12+ value += har_upgrade_price [pilot -> har_id ] * upgrade_level_multiplier [i ] * arm_leg_multiplier ;
13+ }
14+
15+ for (int i = 1 ; i < pilot -> arm_speed ; i ++ ) {
16+ value += har_upgrade_price [pilot -> har_id ] * upgrade_level_multiplier [i ] * arm_leg_multiplier ;
17+ }
18+
19+ for (int i = 1 ; i < pilot -> leg_speed ; i ++ ) {
20+ value += har_upgrade_price [pilot -> har_id ] * upgrade_level_multiplier [i ] * arm_leg_multiplier ;
21+ }
22+
23+ for (int i = 1 ; i < pilot -> armor ; i ++ ) {
24+ value += har_upgrade_price [pilot -> har_id ] * upgrade_level_multiplier [i ] * armor_multiplier ;
25+ }
26+
27+ for (int i = 1 ; i < pilot -> stun_resistance ; i ++ ) {
28+ value += har_upgrade_price [pilot -> har_id ] * upgrade_level_multiplier [i ] * stun_res_multiplier ;
29+ }
30+
31+ pilot -> total_value = value ;
32+ }
Original file line number Diff line number Diff line change 1+ #ifndef ECONOMY_H
2+ #define ECONOMY_H
3+
4+ #include "formats/pilot.h"
5+
6+ void update_total_value (sd_pilot * );
7+
8+ #endif // ECONOMY_H
You can’t perform that action at this time.
0 commit comments