Smart Contract
ArenaBoyzGlobals
A.e5b1b335fdaaf4e2.ArenaBoyzGlobals
1pub contract ArenaBoyzGlobals {
2 pub var targetables_start : UInt8
3 pub var hp_base : UInt16
4 pub var damage_base: UInt16
5 pub var defense_base: UInt16
6 pub var accuracy_base: UInt16
7 pub var speed_base: UInt16
8 pub var counter_base: UInt16
9 pub var turns_per_circle: UInt32
10 pub var ar_start: UInt8
11 pub var sniper_start: UInt8
12 pub var smg_start: UInt8
13 pub var shotgun_start: UInt8
14 pub var throwable_start: UInt8
15 pub var healing_start: UInt8
16 pub var shield_start: UInt8
17 pub var stim_start: UInt8
18 pub var medal_start: UInt8
19 pub var damage_start: UInt8
20 pub var defense_start: UInt8
21 pub var accuracy_start: UInt8
22 pub var speed_start: UInt8
23 pub var counter_start: UInt8
24 pub var items_end: UInt8
25 pub var effective_item_max: Int
26 pub var heal_per_level : UInt16
27 pub var throwable_damage_per_level: UInt16
28 pub var shield_per_level : UInt16
29 pub var stim_per_level : UFix64
30 pub var medal_max_hp_per_level : UInt16
31 pub var free_max_hp_per_level : UInt16
32 pub var targetable_bonus_per_level : UInt16
33 pub var equipment_bonus_per_level : UInt16
34 pub var primary_bonus_per_thresh : UInt16
35 pub var threshhold_amount : UInt16
36 pub var minimum_damage_divisor : UInt16
37 pub var heroes_per_pod : UInt32
38 pub var scavenge_pool_0: [UInt8; 32]
39 pub var scavenge_pool_1: [UInt8; 32]
40 pub var scavenge_pool_2: [UInt8; 32]
41 pub var scavenge_pool_3: [UInt8; 32]
42 pub var scavenge_pool_4: [UInt8; 32]
43 pub var scavenge_pool_5: [UInt8; 32]
44 pub var scavenge_pool_6: [UInt8; 32]
45 pub var starting_primary_pool: [UInt8; 4]
46 pub var seconds_per_turn : Int
47
48 init() {
49 self.heroes_per_pod = 4 //number of heroes that are in a pod, which is a group that can interact with eachother
50 self.effective_item_max = 12 //number of items a hero can hold in inventory. they can actually hold twice as many as this, but the other items dont do anything and will be dropped at end of turn
51 self.targetables_start = 33 //this is what item index the primary weapons stop at and targetable items start at
52 self.hp_base = 875 //starting hp, some randomity is applied, usually 10-20%, see the contract under GenerateHero
53 self.damage_base = 375 //starting damage
54 self.defense_base = 200 //starting
55 self.accuracy_base = 200 //starting
56 self.speed_base = 200 //starting
57 self.counter_base = 200 //starting
58 self.turns_per_circle = 3 //how many turns pass before the scavenge pool is refreshed and heroes are healed back to max_hitpoints
59 self.ar_start = 1 //what item index ars start at
60 self.sniper_start = 9 //item index sniper rifles start at
61 self.smg_start = 17 //smgs
62 self.shotgun_start = 25 //shotguns
63 self.throwable_start = 33 //what item index throwables start at specifically, not just targetables above
64 self.healing_start = 41 //what item index healing starts at
65 self.shield_start = 49 //shields
66 self.stim_start = 57 //stims
67 self.medal_start = 65 //medals
68 self.damage_start = 73 //item index damage equipment starts at, this is not a throwable and is a permanent item
69 self.defense_start = 81 //defense equipment
70 self.accuracy_start = 89 //accuracy equipment
71 self.speed_start = 97 //speed equipment
72 self.counter_start = 105 //counter equipment
73 self.items_end = 113 //all items end here for now
74 self.heal_per_level = 100 //how much healing targetables heal per level. so a level 1 healing heals 200, a level 5 healing heals 1000
75 self.throwable_damage_per_level = 200 //how much damage throwables like grenades do per level. so a level 1 knives do 200, a level 5 disposable laser or whatever does 1000
76 self.shield_per_level = 100 //this will be how much shields are granted by shields, shields are temp and are removed at end of turn
77 self.stim_per_level = 0.5 //stim is bonus mult to stats gained from attack bonus
78 self.medal_max_hp_per_level = 65 //medal is bonus HP granted at end of POD, not end of level.
79 self.free_max_hp_per_level = 65 //this is free HP granted at end of POD
80 self.targetable_bonus_per_level = 10 //this is how much a targetable ALSO grants you per bonus if you hold it at end of POD before it is deleted, per level. so a level 5 disposable laser also gives you 50 whatever at end of POD
81 self.equipment_bonus_per_level = 20 //this is how much equipment grants just from holding it at any time, per level
82 self.primary_bonus_per_thresh = 3 //this is how much extra damage you are granted per threshold level exceeded per level. so a level 3 primary gives you 15 per 50 in primary stat.
83 self.threshhold_amount = 25 //this is the threshold level, so the 50 above is the 50 here.
84 self.minimum_damage_divisor = 5 //20% this is hard to explain but the minimum amount of damage that any attack can do is 20% of the attacker's total damage, regardless of target defense. we mod this divisor to change it from 20%
85 self.seconds_per_turn = 70 //how long a player is given to take their turn
86 self.scavenge_pool_0 = [2,10,18,26,34,42,50,66,74,82,90,98,106,1,9,17,25,33,41,49,65,73,81,89,97,105,0,0,0,0,0,0] //scavenge pool item index numbers
87 self.scavenge_pool_1 = [3,11,19,27,35,43,51,67,75,83,91,99,107,2,10,18,26,34,42,50,66,74,82,90,98,106,0,0,0,0,0,0] //stims are current removed
88 self.scavenge_pool_2 = [4,12,20,28,36,44,52,68,76,84,92,100,108,3,11,19,27,35,43,51,67,75,83,91,99,107,0,0,0,0,0,0] //from testnet
89 self.scavenge_pool_3 = [5,13,21,29,37,45,53,69,77,85,93,101,109,4,12,20,28,36,44,52,68,76,84,92,100,108,0,0,0,0,0,0]
90 self.scavenge_pool_4 = [6,14,22,30,38,46,54,70,78,86,94,102,110,5,13,21,29,37,45,53,69,77,85,93,101,109,0,0,0,0,0,0]
91 self.scavenge_pool_5 = [7,15,23,31,39,47,55,71,79,87,95,103,111,6,14,22,30,38,46,54,70,78,86,94,102,110,0,0,0,0,0,0]
92 self.scavenge_pool_6 = [8,16,24,32,40,48,56,72,80,88,96,104,112,7,15,23,31,39,47,55,71,79,87,95,103,111,0,0,0,0,0,0]
93 self.starting_primary_pool = [1,9,17,25] //what items can heroes roll at random in their starting kit goes here, they only get one of these at present and they are all primaries.
94 }
95 access(self) fun isOwner(): Bool {
96 return true
97 }
98 pub fun getScavengePool7(): [UInt8; 32] {
99 return [8,16,24,32,40,39,56,72,80,88,96,104,112,7,15,23,31,39,38,55,71,79,87,95,103,111,0,0,0,0,0,0]
100 }
101 pub fun setDamageBase(newDamageBase: UInt16) {
102 pre {
103 self.isOwner(): "Only the contract owner can update this value"
104 }
105
106 self.damage_base = newDamageBase
107 }
108 pub fun setDefenseBase(newDefenseBase: UInt16) {
109 pre {
110 self.isOwner(): "Only the contract owner can update this value"
111 }
112
113 self.defense_base = newDefenseBase
114 }
115 pub fun setSecondsPerTurn(newTurnLength: Int) {
116 pre {
117 self.isOwner(): "Only the contract owner can update this value"
118 }
119
120 self.seconds_per_turn = newTurnLength
121 }
122 pub fun setTurnsPerCircle(newTurnsPerCircle: UInt32) {
123 pre {
124 self.isOwner(): "Only the contract owner can update this value"
125 }
126
127 self.turns_per_circle = newTurnsPerCircle
128 }
129 pub fun setEquipmentBonusPerLevel(newEquipmentBonus: UInt16) {
130 pre {
131 self.isOwner(): "Only the contract owner can update this value"
132 }
133
134 self.equipment_bonus_per_level = newEquipmentBonus
135 }
136 pub fun setShieldPerLevel(newShieldPerLevel: UInt16) {
137 pre {
138 self.isOwner(): "Only the contract owner can update this value"
139 }
140
141 self.shield_per_level = newShieldPerLevel
142 }
143 pub fun setHealPerLevel(newHealPerLevel: UInt16) {
144 pre {
145 self.isOwner(): "Only the contract owner can update this value"
146 }
147
148 self.heal_per_level = newHealPerLevel
149 }
150 pub fun setMedalMaxPerLevel(newMedalMaxPerLevel: UInt16) {
151 pre {
152 self.isOwner(): "Only the contract owner can update this value"
153 }
154
155 self.medal_max_hp_per_level = newMedalMaxPerLevel
156 }
157 pub fun setFreeMaxHpPerLevel(newFreeMaxHpPerLevel: UInt16) {
158 pre {
159 self.isOwner(): "Only the contract owner can update this value"
160 }
161
162 self.free_max_hp_per_level = newFreeMaxHpPerLevel
163 }
164 pub fun setThreshholdAmount(newThreshholdAmount: UInt16) {
165 pre {
166 self.isOwner(): "Only the contract owner can update this value"
167 }
168
169 self.threshhold_amount = newThreshholdAmount
170 }
171 pub fun setPrimaryBonusPerThresh(newPrimaryBonus: UInt16) {
172 pre {
173 self.isOwner(): "Only the contract owner can update this value"
174 }
175
176 self.primary_bonus_per_thresh = newPrimaryBonus
177 }
178 pub fun setHeroesPerPod(newHeroesPerPod: UInt32) {
179 pre {
180 self.isOwner(): "Only the contract owner can update this value"
181 }
182
183 self.heroes_per_pod = newHeroesPerPod
184 }
185 pub fun SetScavengePool(index: Int, pool: [UInt8; 32]) {
186 if index == 0 {
187 self.scavenge_pool_0 = pool
188 } else if index == 1 {
189 self.scavenge_pool_1 = pool
190 } else if index == 2 {
191 self.scavenge_pool_2 = pool
192 } else if index == 3 {
193 self.scavenge_pool_3 = pool
194 } else if index == 4 {
195 self.scavenge_pool_4 = pool
196 } else if index == 5 {
197 self.scavenge_pool_5 = pool
198 } else if index == 6 {
199 self.scavenge_pool_6 = pool
200 } else {
201 panic("Invalid scavenge pool index")
202 }
203 }
204}