mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 03:33:21 +00:00
Merge branch 'master' of https://github.com/VOREStation/VOREStation
# Conflicts: # .gitignore # vorestation.dme
This commit is contained in:
@@ -148,11 +148,19 @@
|
||||
return
|
||||
|
||||
user << "<span class='notice'>The crate is locked with a Deca-code lock.</span>"
|
||||
var/input = input(user, "Enter [codelen] digits.", "Deca-Code Lock", "") as text
|
||||
var/input = input(usr, "Enter [codelen] digits. All digits must be unique.", "Deca-Code Lock", "") as text
|
||||
if(!Adjacent(user))
|
||||
return
|
||||
var/list/sanitised = list()
|
||||
var/sanitycheck = 1
|
||||
for(var/i=1,i<=length(input),i++) //put the guess into a list
|
||||
sanitised += text2num(copytext(input,i,i+1))
|
||||
for(var/i=1,i<=(length(input)-1),i++) //compare each digit in the guess to all those following it
|
||||
for(var/j=(i+1),j<=length(input),j++)
|
||||
if(sanitised[i] == sanitised[j])
|
||||
sanitycheck = null //if a digit is repeated, reject the input
|
||||
|
||||
if(input == null || length(input) != codelen)
|
||||
if(input == null || sanitycheck == null || length(input) != codelen)
|
||||
user << "<span class='notice'>You leave the crate alone.</span>"
|
||||
else if(check_input(input))
|
||||
user << "<span class='notice'>The crate unlocks!</span>"
|
||||
@@ -203,6 +211,9 @@
|
||||
else if(lastattempt[i] in code_contents)
|
||||
++cows
|
||||
code_contents -= lastattempt[i]
|
||||
user << "<span class='notice'>Last code attempt had [bulls] correct digits at correct positions and [cows] correct digits at incorrect positions.</span>"
|
||||
var/previousattempt = null //convert back to string for readback
|
||||
for(var/i in 1 to codelen)
|
||||
previousattempt = addtext(previousattempt, lastattempt[i])
|
||||
user << "<span class='notice'>Last code attempt, [previousattempt], had [bulls] correct digits at correct positions and [cows] correct digits at incorrect positions.</span>"
|
||||
return
|
||||
..()
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
var/list/resource_field = list()
|
||||
|
||||
var/ore_types = list(
|
||||
"iron" = /obj/item/weapon/ore/iron,
|
||||
"hematite" = /obj/item/weapon/ore/iron,
|
||||
"uranium" = /obj/item/weapon/ore/uranium,
|
||||
"gold" = /obj/item/weapon/ore/gold,
|
||||
"silver" = /obj/item/weapon/ore/silver,
|
||||
@@ -26,7 +26,7 @@
|
||||
"osmium" = /obj/item/weapon/ore/osmium,
|
||||
"hydrogen" = /obj/item/weapon/ore/hydrogen,
|
||||
"silicates" = /obj/item/weapon/ore/glass,
|
||||
"carbonaceous rock" = /obj/item/weapon/ore/coal
|
||||
"carbon" = /obj/item/weapon/ore/coal
|
||||
)
|
||||
|
||||
//Upgrades
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
var/ore_type
|
||||
|
||||
switch(metal)
|
||||
if("silicates", "carbonaceous rock", "iron") ore_type = "surface minerals"
|
||||
if("silicates", "carbon", "hematite") ore_type = "surface minerals"
|
||||
if("gold", "silver", "diamond") ore_type = "precious metals"
|
||||
if("uranium") ore_type = "nuclear fuel"
|
||||
if("phoron", "osmium", "hydrogen") ore_type = "exotic matter"
|
||||
|
||||
@@ -175,9 +175,8 @@ var/list/mining_overlay_cache = list()
|
||||
|
||||
if(severity <= 2) // Now to expose the ore lying under the sand.
|
||||
spawn(1) // Otherwise most of the ore is lost to the explosion, which makes this rather moot.
|
||||
var/losses = rand(0.5, 1) // Between 0% to 50% loss due to booms.
|
||||
for(var/ore in resources)
|
||||
var/amount_to_give = Ceiling(resources[ore] * losses) // Should result in at least one piece of ore.
|
||||
var/amount_to_give = rand(Ceiling(resources[ore]/2), resources[ore]) // Should result in at least one piece of ore.
|
||||
for(var/i=1, i <= amount_to_give, i++)
|
||||
var/oretype = ore_types[ore]
|
||||
new oretype(src)
|
||||
|
||||
Reference in New Issue
Block a user