From 44c70a028f470de4d182139784322c90afa931de Mon Sep 17 00:00:00 2001 From: Kistaro Windrider Date: Sun, 26 Jan 2025 12:45:43 -0800 Subject: [PATCH] fix starting ammo --- vacuum_gambit.p8 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vacuum_gambit.p8 b/vacuum_gambit.p8 index 62408d9..1ed8a2c 100644 --- a/vacuum_gambit.p8 +++ b/vacuum_gambit.p8 @@ -688,6 +688,8 @@ gun_base = mknew{ -- as an action, assign -- themselves to the player function gun_base:action() + local item = self.new() + item.ammo = item.maxammo if not primary_ship.special_guns then primary_ship.special_guns = {self.new()} else @@ -1843,8 +1845,8 @@ function rearm_mode:update() -- todo: rewrite for three guns local specs = primary_ship.special_guns if specs then - specs[1].ammo = specs[1].max_ammo - if (specs[2]) specs[2].ammo = specs[2].max_ammo + specs[1].ammo = specs[1].maxammo + if (specs[2]) specs[2].ammo = specs[2].maxammo end primary_ship.hp = min(primary_ship.maxhp, primary_ship.hp + primary_ship.maxhp/2) primary_ship.xp -= primary_ship.xptarget / 2