12/21 modernizations from TG live (#103)
* sync (#3) * shuttle auto call * Merge /vore into /master (#39) * progress * Compile errors fixed No idea if it's test worthy tho as conflicts with race overhaul and narky removal. * Update admins.txt * efforts continue Fuck grab code, seriously * grab code is cancer * Execute the Narkism Do not hesitate. Show no mercy. * holy shit grab code is awful * have I bitched about grab code My bitching, let me show you it * código de agarre es una mierda No really it is * yeah I don't even know anymore. * Lolnope. Fuck grab code * I'm not even sure what to fix anymore * Self eating is not an acceptable fate * Taste the void, son. * My code doesn't pass it's own sanity check. Maybe it's a sign of things to come. * uncommented and notes * It Works and I Don't Know Why (#38) * shuttle auto call * it works and I don't know why * Subsystem 12/21 Most Recent TG subsystem folder * globalvars 12/21 Tossed out the flavor_misc and parallax files * Onclick 12/21 as well as .dme updates * _defines 12/21 ommited old _MC.dm * _HELPERS 12/21 Preserved snowflake placement of furry sprites * _defeines/genetics reapplied narkism holdover for snowflake races. * Oops forgot mutant colors * modules porting 12/21 + Sounds/icons Admin, Client and most of mob life files ommitted * enviroment file * Admin optimizations ahelp log system kept * Mob ports 12/21 Flavor text preserved * datums ported 12/21 * Game ported 12/21 * batch of duplicate fixes/dogborg work Dogborgs need to be modernized to refractored borg standards. * moar fixes * Maps and futher compile fixes
This commit is contained in:
@@ -4,19 +4,21 @@
|
||||
name = "abandoned crate"
|
||||
desc = "What could be inside?"
|
||||
icon_state = "securecrate"
|
||||
integrity_failure = 0 //no breaking open the crate
|
||||
var/code = null
|
||||
var/lastattempt = null
|
||||
var/attempts = 10
|
||||
var/codelen = 4
|
||||
tamperproof = 90
|
||||
|
||||
/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)
|
||||
@@ -45,7 +47,7 @@
|
||||
for(var/i in 1 to 3)
|
||||
new /obj/item/weapon/reagent_containers/glass/beaker/noreact(src)
|
||||
if(31 to 35)
|
||||
new /obj/item/seeds/cash(src)
|
||||
new /obj/item/seeds/firelemon(src)
|
||||
if(36 to 40)
|
||||
new /obj/item/weapon/melee/baton(src)
|
||||
if(41 to 45)
|
||||
@@ -54,7 +56,7 @@
|
||||
if(46 to 50)
|
||||
new /obj/item/clothing/under/chameleon(src)
|
||||
for(var/i in 1 to 7)
|
||||
new /obj/item/clothing/tie/horrible(src)
|
||||
new /obj/item/clothing/neck/tie/horrible(src)
|
||||
if(51 to 52) // 2% chance
|
||||
new /obj/item/weapon/melee/classic_baton(src)
|
||||
if(53 to 54)
|
||||
@@ -65,13 +67,13 @@
|
||||
if(57 to 58)
|
||||
new /obj/item/toy/syndicateballoon(src)
|
||||
if(59 to 60)
|
||||
new /obj/item/weapon/gun/energy/kinetic_accelerator/hyper(src)
|
||||
new /obj/item/borg/upgrade/modkit/aoe/mobs(src)
|
||||
new /obj/item/clothing/suit/space(src)
|
||||
new /obj/item/clothing/head/helmet/space(src)
|
||||
if(61 to 62)
|
||||
for(var/i in 1 to 5)
|
||||
new /obj/item/clothing/head/kitty(src)
|
||||
new /obj/item/clothing/tie/petcollar(src)
|
||||
new /obj/item/clothing/neck/petcollar(src)
|
||||
if(63 to 64)
|
||||
for(var/i in 1 to rand(4, 7))
|
||||
var/newcoin = pick(/obj/item/weapon/coin/silver, /obj/item/weapon/coin/silver, /obj/item/weapon/coin/silver, /obj/item/weapon/coin/iron, /obj/item/weapon/coin/iron, /obj/item/weapon/coin/iron, /obj/item/weapon/coin/gold, /obj/item/weapon/coin/diamond, /obj/item/weapon/coin/plasma, /obj/item/weapon/coin/uranium)
|
||||
@@ -140,7 +142,7 @@
|
||||
new /obj/item/weapon/hand_tele(src)
|
||||
if(97)
|
||||
new /obj/item/clothing/mask/balaclava
|
||||
new /obj/item/weapon/gun/projectile/automatic/pistol(src)
|
||||
new /obj/item/weapon/gun/ballistic/automatic/pistol(src)
|
||||
new /obj/item/ammo_box/magazine/m10mm(src)
|
||||
if(98)
|
||||
new /obj/item/weapon/katana/cursed(src)
|
||||
@@ -153,27 +155,32 @@
|
||||
/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)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/structure/closet/crate/secure/loot/attack_animal(mob/user)
|
||||
boom(user)
|
||||
|
||||
/obj/structure/closet/crate/secure/loot/AltClick(mob/living/user)
|
||||
if(!user.canUseTopic(src))
|
||||
return
|
||||
@@ -192,19 +199,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 ..()
|
||||
|
||||
@@ -214,10 +223,5 @@
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/structure/closet/crate/secure/loot/proc/boom(mob/user)
|
||||
user << "<span class='danger'>The crate's anti-tamper system activates!</span>"
|
||||
for(var/atom/movable/AM in src)
|
||||
qdel(AM)
|
||||
var/turf/T = get_turf(src)
|
||||
explosion(T, -1, -1, 1, 1)
|
||||
qdel(src)
|
||||
/obj/structure/closet/crate/secure/loot/deconstruct(disassembled = TRUE)
|
||||
boom()
|
||||
|
||||
Reference in New Issue
Block a user