Skip to content

Commit c4b6a61

Browse files
committed
WIP: Add economy .. maybe
1 parent eb3c007 commit c4b6a61

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

src/game/protos/economy.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
}

src/game/protos/economy.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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

0 commit comments

Comments
 (0)