mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 12:41:09 +01:00
Merge branch 'master' of https://github.com/tgstation/-tg-station into why_did_this_take_months
# Conflicts: # code/modules/client/preferences_savefile.dm
This commit is contained in:
@@ -11,12 +11,12 @@
|
||||
|
||||
/obj/structure/closet/crate/secure/loot/New()
|
||||
..()
|
||||
var/list/digits = list("1", "2", "3", "4", "5", "6", "7", "8", "9", "z")
|
||||
var/list/digits = list("1", "2", "3", "4", "5", "6", "7", "8", "9", "0")
|
||||
code = ""
|
||||
for(var/i = 0, i < codelen, i++)
|
||||
var/dig = pick(digits)
|
||||
code += dig
|
||||
digits -= dig //Player can enter codes with matching digits, but there are never matching digits in the answer
|
||||
digits -= dig //there are never matching digits in the answer
|
||||
|
||||
var/loot = rand(1,100) //100 different crates with varying chances of spawning
|
||||
switch(loot)
|
||||
@@ -153,18 +153,26 @@
|
||||
/obj/structure/closet/crate/secure/loot/attack_hand(mob/user)
|
||||
if(locked)
|
||||
user << "<span class='notice'>The crate is locked with a Deca-code lock.</span>"
|
||||
var/input = input(usr, "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(user.canUseTopic(src, 1))
|
||||
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 == code)
|
||||
user << "<span class='notice'>The crate unlocks!</span>"
|
||||
locked = 0
|
||||
cut_overlays()
|
||||
add_overlay("securecrateg")
|
||||
else if (input == null || length(input) != codelen)
|
||||
else if (input == null || sanitycheck == null || length(input) != codelen)
|
||||
user << "<span class='notice'>You leave the crate alone.</span>"
|
||||
else
|
||||
user << "<span class='warning'>A red light flashes.</span>"
|
||||
lastattempt = replacetext(input, 0, "z")
|
||||
lastattempt = input
|
||||
attempts--
|
||||
if(attempts == 0)
|
||||
boom(user)
|
||||
@@ -192,19 +200,21 @@
|
||||
user << "<span class='notice'>* Anti-Tamper Bomb will activate after [src.attempts] failed access attempts.</span>"
|
||||
if(lastattempt != null)
|
||||
var/list/guess = list()
|
||||
var/list/answer = list()
|
||||
var/bulls = 0
|
||||
var/cows = 0
|
||||
for(var/i = 1, i < codelen + 1, i++)
|
||||
var/a = copytext(lastattempt, i, i+1) //Stuff the code into the list
|
||||
guess += a
|
||||
guess[a] = i
|
||||
for(var/i in guess) //Go through list and count matches
|
||||
var/a = findtext(code, i)
|
||||
if(a == guess[i])
|
||||
++bulls
|
||||
else if(a)
|
||||
for(var/i=1,i<=length(lastattempt),i++)
|
||||
guess += text2num(copytext(lastattempt,i,i+1))
|
||||
for(var/i=1,i<=length(lastattempt),i++)
|
||||
answer += text2num(copytext(code,i,i+1))
|
||||
for(var/i = 1, i < codelen + 1, i++) // Go through list and count matches
|
||||
if( answer.Find(guess[i],1,codelen+1))
|
||||
++cows
|
||||
user << "<span class='notice'>Last code attempt had [bulls] correct digits at correct positions and [cows] correct digits at incorrect positions.</span>"
|
||||
if( answer[i] == guess[i])
|
||||
++bulls
|
||||
--cows
|
||||
|
||||
user << "<span class='notice'>Last code attempt, [lastattempt], had [bulls] correct digits at correct positions and [cows] correct digits at incorrect positions.</span>"
|
||||
return
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
if(16)
|
||||
new /obj/item/weapon/guardiancreator(src)
|
||||
if(17)
|
||||
new /obj/item/borg/upgrade/modkit/aoe/mobs(src)
|
||||
new /obj/item/borg/upgrade/modkit/aoe/turfs/andmobs(src)
|
||||
if(18)
|
||||
new /obj/item/device/warp_cube/red(src)
|
||||
if(19)
|
||||
@@ -195,7 +195,7 @@
|
||||
|
||||
/obj/item/projectile/hook/fire(setAngle)
|
||||
if(firer)
|
||||
chain = Beam(firer, icon_state = "chain", icon = 'icons/obj/lavaland/artefacts.dmi', time = INFINITY, maxdistance = INFINITY)
|
||||
chain = firer.Beam(src, icon_state = "chain", time = INFINITY, maxdistance = INFINITY)
|
||||
..()
|
||||
|
||||
/obj/item/projectile/hook/on_hit(atom/target)
|
||||
@@ -704,15 +704,13 @@
|
||||
|
||||
/obj/structure/closet/crate/necropolis/bubblegum/New()
|
||||
..()
|
||||
var/loot = rand(1,4)
|
||||
var/loot = rand(1,3)
|
||||
switch(loot)
|
||||
if(1)
|
||||
new /obj/item/weapon/antag_spawner/slaughter_demon(src)
|
||||
if(2)
|
||||
new /obj/item/mayhem(src)
|
||||
if(3)
|
||||
if(2)
|
||||
new /obj/item/blood_contract(src)
|
||||
if(4)
|
||||
if(3)
|
||||
new /obj/item/weapon/gun/magic/staff/spellblade(src)
|
||||
|
||||
/obj/item/blood_contract
|
||||
|
||||
@@ -38,13 +38,14 @@
|
||||
new /datum/data/mining_equipment("Mining Hardsuit", /obj/item/clothing/suit/space/hardsuit/mining, 2000),
|
||||
new /datum/data/mining_equipment("Diamond Pickaxe", /obj/item/weapon/pickaxe/diamond, 2000),
|
||||
new /datum/data/mining_equipment("Super Resonator", /obj/item/weapon/resonator/upgraded, 2500),
|
||||
new /datum/data/mining_equipment("KA White Tracer Rounds", /obj/item/borg/upgrade/modkit/tracer, 200),
|
||||
new /datum/data/mining_equipment("KA Adjustable Tracer Rounds", /obj/item/borg/upgrade/modkit/tracer/adjustable, 300),
|
||||
new /datum/data/mining_equipment("KA Super Chassis", /obj/item/borg/upgrade/modkit/chassis_mod, 400),
|
||||
new /datum/data/mining_equipment("KA Hyper Chassis", /obj/item/borg/upgrade/modkit/chassis_mod/orange, 500),
|
||||
new /datum/data/mining_equipment("KA White Tracer Rounds", /obj/item/borg/upgrade/modkit/tracer, 100),
|
||||
new /datum/data/mining_equipment("KA Adjustable Tracer Rounds", /obj/item/borg/upgrade/modkit/tracer/adjustable, 150),
|
||||
new /datum/data/mining_equipment("KA Super Chassis", /obj/item/borg/upgrade/modkit/chassis_mod, 250),
|
||||
new /datum/data/mining_equipment("KA Hyper Chassis", /obj/item/borg/upgrade/modkit/chassis_mod/orange, 300),
|
||||
new /datum/data/mining_equipment("KA Range Increase", /obj/item/borg/upgrade/modkit/range, 1000),
|
||||
new /datum/data/mining_equipment("KA Damage Increase", /obj/item/borg/upgrade/modkit/damage, 1000),
|
||||
new /datum/data/mining_equipment("KA Cooldown Decrease",/obj/item/borg/upgrade/modkit/cooldown, 1000),
|
||||
new /datum/data/mining_equipment("KA AoE Damage", /obj/item/borg/upgrade/modkit/aoe/mobs, 2000),
|
||||
new /datum/data/mining_equipment("Point Transfer Card", /obj/item/weapon/card/mining_point_card, 500),
|
||||
new /datum/data/mining_equipment("Mining Drone", /mob/living/simple_animal/hostile/mining_drone, 800),
|
||||
new /datum/data/mining_equipment("Drone Melee Upgrade", /obj/item/device/mine_bot_ugprade, 400),
|
||||
|
||||
@@ -313,7 +313,6 @@
|
||||
desc = "An easily-compressable wall used for temporary shelter."
|
||||
icon = 'icons/turf/walls/survival_pod_walls.dmi'
|
||||
icon_state = "smooth"
|
||||
walltype = "shuttle"
|
||||
smooth = SMOOTH_MORE|SMOOTH_DIAGONAL
|
||||
canSmoothWith = list(/turf/closed/wall/shuttle/survival, /obj/machinery/door/airlock/survival_pod, /obj/structure/window/shuttle/survival_pod, /obj/structure/shuttle/engine)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user