mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 04:26:03 +01:00
Merge pull request #10782 from phil235/VendingCharges
Mech & vending machine fixes
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
var/broken = 0 // ={0,1,2} How broken is it???
|
||||
var/max_n_of_items = 10 // whatever fat fuck made this a global var needs to look at themselves in the mirror sometime
|
||||
var/efficiency = 0
|
||||
var/microwavepower = 1
|
||||
|
||||
|
||||
// see code/modules/food/recipes_microwave.dm for recipes
|
||||
@@ -203,12 +202,6 @@
|
||||
dat = "<h3>Ingredients:</h3>[dat]</div>"
|
||||
dat += "<A href='?src=\ref[src];action=cook'>Turn on</A>"
|
||||
dat += "<A href='?src=\ref[src];action=dispose'>Eject ingredients</A><BR>"
|
||||
dat += "Microwave Power: [microwavepower*200]W<BR>"
|
||||
dat += "<A href='?src=\ref[src];action=power;amount=1'>200W</A>"
|
||||
dat += "<A href='?src=\ref[src];action=power;amount=2'>400W</A>"
|
||||
dat += "<A href='?src=\ref[src];action=power;amount=3'>600W</A>"
|
||||
dat += "<A href='?src=\ref[src];action=power;amount=4'>800W</A>"
|
||||
dat += "<A href='?src=\ref[src];action=power;amount=5'>1000W</A><BR>"
|
||||
|
||||
var/datum/browser/popup = new(user, "microwave", name, 300, 300)
|
||||
popup.set_content(dat)
|
||||
@@ -224,7 +217,7 @@
|
||||
return
|
||||
start()
|
||||
|
||||
if (prob(max(microwavepower*5/efficiency-5,dirty*5))) //a clean unupgraded microwave on lowest power has no risk of failure
|
||||
if (prob(max(5/efficiency-5,dirty*5))) //a clean unupgraded microwave has no risk of failure
|
||||
muck_start()
|
||||
if (!microwaving(4))
|
||||
muck_finish()
|
||||
@@ -265,7 +258,7 @@
|
||||
if (stat & (NOPOWER|BROKEN))
|
||||
return 0
|
||||
use_power(500)
|
||||
sleep(max(14-2*microwavepower-2*efficiency,2)) // standard power means sleep(10). The higher the power and the better the efficiency, the faster the cooking
|
||||
sleep(max(12-2*efficiency,2)) // standard microwave means sleep(10). The better the efficiency, the faster the cooking
|
||||
return 1
|
||||
|
||||
/obj/machinery/microwave/proc/has_extra_item()
|
||||
@@ -340,10 +333,5 @@
|
||||
|
||||
if ("dispose")
|
||||
dispose()
|
||||
if ("power")
|
||||
var/amount = text2num(href_list["amount"])
|
||||
if(amount<1 || amount>5)
|
||||
return
|
||||
microwavepower = amount
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
@@ -468,26 +468,21 @@
|
||||
user << "<span class='warning'>You can't improve [C] any further!</span>"
|
||||
return
|
||||
if(istype(target, /obj/mecha/working/ripley))
|
||||
var/obj/mecha/D = target
|
||||
var/obj/mecha/working/ripley/D = target
|
||||
var/list/damage_absorption = D.damage_absorption
|
||||
if(damage_absorption["brute"] > 0.3)
|
||||
if(D.hides < 3)
|
||||
D.hides++
|
||||
damage_absorption["brute"] = max(damage_absorption["brute"] - 0.1, 0.3)
|
||||
damage_absorption["bullet"] = damage_absorption["bullet"] - 0.05
|
||||
damage_absorption["fire"] = damage_absorption["fire"] - 0.05
|
||||
damage_absorption["laser"] = damage_absorption["laser"] - 0.025
|
||||
user << "<span class='info'>You strengthen [target], improving its resistance against melee attacks.</span>"
|
||||
qdel(src)
|
||||
if(D.icon_state == "ripley-open")
|
||||
D.overlays += image("icon"="mecha.dmi", "icon_state"="ripley-g-open")
|
||||
D.desc = "Autonomous Power Loader Unit. Its armour is enhanced with some goliath hide plates."
|
||||
D.update_icon()
|
||||
if(D.hides == 3)
|
||||
D.desc = "Autonomous Power Loader Unit. It's wearing a fearsome carapace entirely composed of goliath hide plates - its pilot must be an experienced monster hunter."
|
||||
else
|
||||
user << "<span class='info'>You can't add armour onto the mech while someone is inside!</span>"
|
||||
if(damage_absorption.["brute"] == 0.3)
|
||||
if(D.icon_state == "ripley-open")
|
||||
D.overlays += image("icon"="mecha.dmi", "icon_state"="ripley-g-full-open")
|
||||
D.desc = "Autonomous Power Loader Unit. It's wearing a fearsome carapace entirely composed of goliath hide plates - the pilot must be an experienced monster hunter."
|
||||
else
|
||||
user << "<span class='warning'>You can't add armour onto the mech while someone is inside!</span>"
|
||||
D.desc = "Autonomous Power Loader Unit. Its armour is enhanced with some goliath hide plates."
|
||||
qdel(src)
|
||||
else
|
||||
user << "<span class='warning'>You can't improve [D] any further!</span>"
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user