11local dice = require (' code.libs.dice' )
2- local flags = require (' code.player.skills.flags' )
32local medical = require (' code.item.medical.class' )
43
54local activate = {}
@@ -12,38 +11,38 @@ function activate.FAK(player, condition, target)
1211 local FAK_dice = dice :new (medical .FAK :getDice ())
1312 local tile = player :getTile ()
1413
15- if player .skills :check (flags . recovery ) and tile :isBuilding () and tile :isPowered () and player :isStaged (' inside' ) then
14+ if player .skills :check (' healing ' ) and tile :isBuilding () and tile :isPowered () and player :isStaged (' inside' ) then
1615 FAK_dice = FAK_dice * 1
1716-- print('powered confirmed')
1817-- print(tile:getClassName(), tile:getName(), tile:getTileType() )
19- if player .skills :check (flags . major_healing ) and tile :isClass (' hospital' ) then
18+ if player .skills :check (' major_healing' ) and tile :isClass (' hospital' ) then
2019 FAK_dice = FAK_dice * 1
2120-- print('hosptial confirmed')
2221 end
2322 end
2423
25- if player .skills :check (flags . major_healing_adv ) then
24+ if player .skills :check (' major_healing ' ) then
2625 FAK_dice = FAK_dice ^ 1
2726 FAK_dice = FAK_dice .. ' ^^'
28- end
27+ end
2928
3029 local hp_gained = FAK_dice :roll ()
3130 target :updateHP (hp_gained )
3231 -- target:event trigger
33- print (' You heal with ' .. FAK : getName () .. ' for ' .. hp_gained .. ' hp.' )
32+ print (' You heal with the first aid kit for ' .. hp_gained .. ' hp.' )
3433end
3534
3635function activate .bandage (player , condition , target )
3736 local bandage_dice = dice :new (medical .bandage :getDice ())
37+ local tile = player :getTile ()
38+
39+ if tile :isBuilding () and tile :isPowered () and player :isStaged (' inside' ) then bandage_dice = bandage_dice + 1 end
3840
39- if player .skills :check (flags . recovery ) then
41+ if player .skills :check (' healing ' ) then
4042 bandage_dice = bandage_dice + 1
41- if player .skills :check (flags .minor_healing ) then
42- bandage_dice = bandage_dice + 1
43- if player .skills :check (flags .major_healing_adv ) then
44- bandage_dice = bandage_dice ^ 1
45- bandage_dice = bandage_dice + 1
46- end
43+ if player .skills :check (' minor_healing' ) then
44+ bandage_dice = bandage_dice + 1
45+ bandage_dice = bandage_dice ^ 1
4746 end
4847 end
4948
@@ -53,29 +52,25 @@ function activate.bandage(player, condition, target)
5352 print (' You heal with ' .. bandage :getName ().. ' for ' .. hp_gained .. ' hp.' )
5453end
5554
56- function activate .antidote (player , condition , target )
57- local antidote = medical .antidote
58- local cure_chance = antidote :getAccuracy ()
59- -- modify chance based on skills?
60-
61- local cure_success = cure_chance >= math.random ()
62- -- target:updateStatusEffects?
63- -- target:event trigger
64- if cure_success then
65- print (' You cure with the ' .. antidote :getName ().. ' .' )
66- else
67- print (' You fail to cure with the ' .. antidote :getName ().. ' .' )
68- end
69- end
55+ local syringe_hp_ranges = {3 , 6 , 9 , 12 }
7056
7157function activate .syringe (player , condition , target )
7258 local syringe = medical .syringe
7359 local inject_chance = syringe :getAccuracy ()
74- -- modify chance based on skills?
60+ if player .skills :check (' syringe' ) then
61+ inject_chance = inject_chance + 0.05
62+ if player .skills :check (" syringe_adv" ) then
63+ inject_chance = inject_chance + 0.05
64+ end
65+ end
7566
7667 local inject_success = inject_chance >= math.random ()
77- target :killed (' syringe' )
68+ local target_weak_enough = syringe_hp_ranges [condition ] >= target :getStat (' hp' )
69+
70+ if inject_success and target_weak_enough then target :killed () end
7871 -- target:event trigger
72+
73+ return {inject_success , target_weak_enough }
7974end
8075
8176--[[
@@ -104,8 +99,15 @@ function activate.sampler(player, condition, target)
10499
105100end
106101
107- function activate . GPS ( player , condition )
102+ local GPS_basic_chance , GPS_advanced_chance = 0.15 , 0.20
108103
104+ function activate .GPS (player , condition )
105+ local GPS_chance = (player .skils :check (' gadgets' ) and GPS_advanced_chance ) or GPS_basic_chance
106+ local free_movement_success = GPS_chance >= math.random ()
107+ if free_movement_success then -- the GPS has a chance to avoid wasting ap on movement
108+ player :updateStat (' ap' , 1 ) -- this is pretty much a hack (if a player's ap is 50 then they will NOT receive the ap)
109+ end
110+ return {free_movement_success }
109111end
110112
111113function activate .loudspeaker (player , condition , message )
@@ -158,8 +160,7 @@ local book_xp_dice = {'1d3', '1d5', '1d7', '1d10'}
158160function activate .book (player , condition )
159161 local xp_dice_str = book_xp_dice [condition - 1 ]
160162 local book_dice = dice :new (xp_dice_str )
161- if player .skills :check (flags .bookworm ) then book_dice = book_dice ^ 1 end
162- if player :isStaged (' inside' ) and player :getSpotCondition () == ' powered' then book_dice = book_dice / 2 end
163+ if player :isStaged (' inside' ) and player :getSpotCondition () == ' powered' then book_dice = book_dice ^ 1 end
163164 local gained_xp = book_dice :roll ()
164165 player :updateXP (gained_xp )
165166end
0 commit comments