Abandoned Crates

A finalized version of the crate overhaul. Altered mechanics, new loot.
This commit is contained in:
skull132
2014-04-13 02:17:40 +03:00
parent 564c17a6d0
commit 60ece1d2e9
+197 -297
View File
@@ -6,10 +6,11 @@
icon_closed = "securecrate"
var/code = null
var/lastattempt = null
var/attempts = 3
var/attempts = 2
locked = 1
var/min = 1
var/max = 10
// var/tampered = 0
/obj/structure/closet/crate/secure/loot/New()
..()
@@ -17,308 +18,190 @@
var/loot = rand(1,70)
switch(loot)
if(1)
new/obj/item/weapon/reagent_containers/food/drinks/bottle/rum(src)
new/obj/item/weapon/reagent_containers/food/snacks/grown/ambrosiadeus(src)
new/obj/item/weapon/reagent_containers/food/drinks/bottle/whiskey(src)
new/obj/item/weapon/lighter/zippo(src)
if(2)
new/obj/item/weapon/pickaxe/drill(src)
new/obj/item/device/taperecorder(src)
new/obj/item/clothing/suit/space(src)
new/obj/item/clothing/head/helmet/space(src)
if(3)
new/obj/item/weapon/reagent_containers/glass/bottle/adminordrazine(src)
if(4)
new/obj/item/weapon/reagent_containers/glass/beaker/bluespace(src)
if(5 to 6)
for(var/i = 0, i < 10, i++)
new/obj/item/weapon/ore/diamond(src)
if(7)
new/obj/item/weapon/reagent_containers/glass/bottle/cyanide(src)
if(8)
// new/obj/item/weapon/melee/energy/sword(src) Dummy
if(9)
for(var/i = 0, i < 3, i++)
new/obj/machinery/hydroponics(src)
if(10)
for(var/i = 0, i < 3, i++)
new/obj/item/weapon/reagent_containers/glass/beaker/noreact(src)
if(11 to 12)
for(var/i = 0, i < 9, i++)
new/obj/item/bluespace_crystal(src)
if(13)
new/obj/item/weapon/melee/classic_baton(src)
if(14)
new/obj/item/weapon/shield/energy(src)
if(15)
new/obj/item/clothing/under/chameleon(src)
for(var/i = 0, i < 7, i++)
new/obj/item/clothing/tie/horrible(src)
if(16)
new/obj/item/clothing/under/shorts(src)
new/obj/item/clothing/under/shorts/red(src)
new/obj/item/clothing/under/shorts/blue(src)
//Dummy crates start here. //Ha, no. Your dummy crates are dumb and I hope you die. //Sorry Duck, but. Issues with people being dumb.
if(17)
new/obj/item/weapon/melee/energy/sword/pirate(src)
if(18)
// new/obj/item/weapon/twohanded/dualsaber(src) Dummy
if(19)
new/obj/item/weapon/claymore(src)
// new/obj/item/weapon/katana(src)
if(20)
new/obj/item/weapon/pickaxe/diamond(src)
if(2 to 3)
new/obj/item/weapon/pickaxe/gold(src)
if(4 to 5)
new/obj/item/weapon/pickaxe/silver(src)
if(6)
new/obj/item/weapon/pickaxe/plasmacutter(src)
new/obj/item/weapon/pickaxe/diamonddrill(src)
if(21)
new/obj/item/weapon/pickaxe/jackhammer(src)
if(7 to 8)
for(var/i = 0, i < 2, i++)
new/obj/item/weapon/ore/diamond(src)
if(9)
new/obj/item/weapon/pickaxe/drill(src)
if(10 to 12)
for(var/i = 0, i < 5, i++)
new/obj/item/seeds/lemonseed(src)
if(13 to 16)
var/seeds = rand(1,15)
switch(seeds)
if(1 to 3)
new/obj/item/seeds/nettleseed(src)
if(4 to 8)
new/obj/item/seeds/berryseed(src)
new/obj/item/seeds/berryseed(src)
new/obj/item/seeds/berryseed(src)
if(9 to 12)
new/obj/item/seeds/appleseed(src)
new/obj/item/seeds/appleseed(src)
new/obj/item/seeds/appleseed(src)
if(13)
new/obj/item/seeds/bluespacetomatoseed(src)
if(14)
new/obj/item/seeds/sugarcaneseed(src)
if(15)
new/obj/item/seeds/plastiseed(src)
if(17)
new/obj/item/weapon/reagent_containers/glass/beaker/noreact(src)
if(18)
new/obj/item/bluespace_crystal(src)
if(prob(10))
new/obj/item/bluespace_crystal(src)
if(19)
new/obj/item/seeds/kudzuseed(src)
if(20)
new/obj/item/weapon/shield/energy(src)
if(21)
new/obj/item/weapon/coin/iron(src)
if(prob(25))
new/obj/item/weapon/coin/silver(src)
if(22)
new/obj/item/weapon/storage/belt/inflatable(src)
if(23)
new/obj/item/weapon/storage/belt/champion(src)
if(24)
new/obj/item/device/soulstone(src)
new/obj/structure/constructshell(src)
if(25)
// new/obj/item/mecha_parts/chassis/honker(src)
// new/obj/item/mecha_parts/part/honker_torso(src)
new/obj/item/mecha_parts/part/honker_head(src)
// new/obj/item/mecha_parts/part/honker_left_arm(src)
new/obj/item/mecha_parts/part/honker_right_arm(src)
new/obj/item/mecha_parts/part/honker_left_leg(src)
new/obj/item/mecha_parts/part/honker_right_leg(src)
if(26)
// new/obj/item/weapon/bikehorn(src)
new/obj/item/weapon/bikehorn(src)
new/obj/item/weapon/bikehorn(src)
// new/obj/item/weapon/circuitboard/mecha/honker/peripherals(src)
new/obj/item/weapon/circuitboard/mecha/honker/targeting(src)
new/obj/item/weapon/circuitboard/mecha/honker/main(src)
// new/obj/item/mecha_parts/mecha_equipment/weapon/honker(src)
new/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/banana_mortar(src)
new/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/banana_mortar/mousetrap_mortar(src)
if(27)
// new/obj/item/mecha_parts/chassis/phazon(src)
new/obj/item/mecha_parts/part/phazon_torso(src)
new/obj/item/mecha_parts/part/phazon_head(src)
if(28)
new/obj/item/mecha_parts/part/phazon_left_arm(src)
// new/obj/item/mecha_parts/part/phazon_right_arm(src)
new/obj/item/mecha_parts/part/phazon_left_leg(src)
new/obj/item/mecha_parts/part/phazon_right_leg(src)
if(29)
new/obj/item/clothing/mask/facehugger(src)
new/obj/item/clothing/mask/facehugger(src)
new/obj/item/clothing/mask/facehugger(src)
if(30)
// new/obj/item/weapon/gun/energy/staff/focus(src) Dummy
//Dummy crates end here. //is what it would say if we weren't getting rid of the dummy crates for being dumb
if(31)
new/obj/item/weapon/melee/baton(src)
if(32)
new/obj/machinery/zero_point_emitter(src)
if(33)
new/obj/item/weapon/storage/backpack/santabag(src)
new/obj/item/clothing/head/helmet/space/santahat(src)
new/obj/item/clothing/suit/space/santa(src)
if(34)
new/obj/item/weapon/storage/backpack/holding(src)
if(35)
new/obj/item/weapon/storage/backpack/satchel_eng(src)
new/obj/item/weapon/storage/backpack/satchel_med(src)
new/obj/item/weapon/storage/backpack/satchel_vir(src)
new/obj/item/weapon/storage/backpack/satchel_chem(src)
new/obj/item/weapon/storage/backpack/satchel_gen(src)
new/obj/item/weapon/storage/backpack/satchel_tox(src)
new/obj/item/weapon/storage/backpack/satchel_sec(src)
new/obj/item/weapon/storage/backpack/satchel_hyd(src)
new/obj/item/weapon/storage/backpack/satchel_cap(src)
if(36) //Beginning the deadly wildlife crates!
new/mob/living/simple_animal/hostile/carp(src)
new/mob/living/simple_animal/hostile/carp(src)
if(37)
new/mob/living/simple_animal/hostile/carp(src)
new/mob/living/simple_animal/hostile/carp(src)
new/mob/living/simple_animal/hostile/carp(src)
new/mob/living/simple_animal/hostile/carp(src)
if(38)
new/mob/living/simple_animal/hostile/giant_spider(src)
new/mob/living/simple_animal/hostile/giant_spider/nurse(src)
new/mob/living/simple_animal/hostile/giant_spider/hunter(src)
if(39)
new/mob/living/simple_animal/hostile/giant_spider(src)
new/mob/living/simple_animal/hostile/giant_spider/nurse(src)
new/mob/living/simple_animal/hostile/giant_spider/hunter(src)
new/mob/living/simple_animal/hostile/giant_spider(src)
new/mob/living/simple_animal/hostile/giant_spider/nurse(src)
new/mob/living/simple_animal/hostile/giant_spider/hunter(src)
if(40)
new/mob/living/simple_animal/hostile/mimic(src)
if(41)
new/mob/living/simple_animal/hostile/creature(src)
if(43)
new/mob/living/simple_animal/hostile/tree(src)
if(44)
new /obj/item/clothing/suit/chickensuit(src)
new /obj/item/clothing/head/chicken(src)
new/obj/item/weapon/reagent_containers/food/snacks/egg(src)
if(45)
new/obj/item/clothing/under/gladiator(src)
new/obj/item/clothing/head/helmet/gladiator(src)
if(prob(10))
new/obj/item/weapon/coin/adamantine(src)
new/obj/item/weapon/coin/gold(src)
else
new/obj/item/weapon/paper/crumpled(src)
if(23 to 25)
var/nutrient = rand(1,3)
switch(nutrient)
if(1)
new/obj/item/nutrient/ez(src)
new/obj/item/nutrient/ez(src)
new/obj/item/nutrient/ez(src)
if(2)
new/obj/item/nutrient/l4z(src)
new/obj/item/nutrient/l4z(src)
new/obj/item/nutrient/l4z(src)
if(3)
new/obj/item/nutrient/rh(src)
new/obj/item/nutrient/rh(src)
new/obj/item/nutrient/rh(src)
if(26 to 30)
for(var/i = 0, i < 5, i++)
new/obj/item/stack/sheet/metal(src)
if(31 to 35)
for(var/i = 0, i < 5, i++)
new/obj/item/stack/sheet/glass(src)
if(36 to 37)
new/obj/item/stack/sheet/glass/plasmaglass(src)
new/obj/item/stack/sheet/glass/plasmaglass(src)
if(38 to 39)
new/obj/item/stack/sheet/plasteel(src)
new/obj/item/stack/sheet/plasteel(src)
if(40 to 45)
new/obj/item/stack/rods(src)
new/obj/item/stack/rods(src)
new/obj/item/stack/rods(src)
new/obj/item/weapon/shard(src)
new/obj/item/weapon/shard(src)
new/obj/item/weapon/shard(src)
if(46)
new/obj/item/clothing/under/gimmick/rank/captain/suit(src)
new/obj/item/clothing/head/flatcap(src)
new/obj/item/clothing/suit/storage/labcoat/mad(src)
new/obj/item/clothing/glasses/gglasses(src)
new/obj/item/weapon/storage/belt/champion(src)
if(47)
new/obj/item/clothing/under/gimmick/rank/captain/suit(src)
new/obj/item/clothing/head/flatcap(src)
new/obj/item/clothing/mask/cigarette/cigar/havana(src)
new/obj/item/clothing/shoes/jackboots(src)
new/obj/item/weapon/rcd_ammo(src)
new/obj/item/weapon/rcd_ammo(src)
new/obj/item/weapon/rcd_ammo(src)
if(prob(10))
new/obj/item/weapon/rcd(src)
if(48)
new/obj/item/clothing/under/schoolgirl(src)
new/obj/item/clothing/head/kitty(src)
if(49)
new/obj/item/clothing/under/blackskirt(src)
new/obj/item/clothing/head/beret(src)
new/obj/item/clothing/head/rabbitears(src)
new/obj/item/clothing/glasses/sunglasses/blindfold(src)
if(50)
new/obj/item/clothing/suit/wcoat(src)
new/obj/item/clothing/under/suit_jacket(src)
new/obj/item/clothing/head/that(src)
if(51)
new/obj/item/clothing/gloves/white(src)
new/obj/item/clothing/shoes/white(src)
new/obj/item/clothing/under/scratch(src)
new/obj/item/clothing/head/cueball(src)
if(52)
new/obj/item/clothing/under/kilt(src)
new/obj/item/clothing/head/beret(src)
var/pills = rand(1,15)
switch(pills)
if(1 to 4)
new/obj/item/weapon/storage/pill_bottle/antitox(src)
if(5 to 8)
new/obj/item/weapon/storage/pill_bottle/inaprovaline(src)
if(9 to 12)
new/obj/item/weapon/storage/pill_bottle/kelotane(src)
if(13)
new/obj/item/weapon/storage/pill_bottle/dice(src)
if(14)
new/obj/item/weapon/storage/pill_bottle/happy(src)
if(15)
new/obj/item/weapon/storage/pill_bottle/zoom(src)
if(49 to 52)
var/cash = rand(1,7)
switch(cash)
if(1 to 3)
new/obj/item/weapon/spacecash/c10(src)
new/obj/item/weapon/spacecash/c1(src)
new/obj/item/weapon/spacecash/c1(src)
new/obj/item/weapon/spacecash/c1(src)
if(4 to 6)
new/obj/item/weapon/spacecash/c20(src)
if(7)
new/obj/item/weapon/spacecash/c50(src)
if(53)
new/obj/item/clothing/suit/wcoat(src)
new/obj/item/clothing/glasses/monocle(src)
new/obj/item/clothing/head/bowler(src)
new/obj/item/clothing/shoes/black(src)
new/obj/item/weapon/cane(src)
new/obj/item/clothing/under/sl_suit(src)
new/obj/item/clothing/mask/fakemoustache(src)
if(54)
new/obj/item/clothing/suit/bio_suit/plaguedoctorsuit(src)
new/obj/item/clothing/head/plaguedoctorhat(src)
if(55)
new/obj/item/clothing/under/owl(src)
new/obj/item/clothing/mask/gas/owl_mask(src)
new/obj/item/weapon/gun/energy/crossbow(src)
new/obj/item/clothing/shoes/syndigaloshes(src)
if(56)
new/obj/item/clothing/under/waiter(src)
new/obj/item/clothing/head/kitty(src)
new/obj/item/clothing/head/rabbitears(src)
new/obj/item/clothing/suit/apron(src)
if(57)
new/obj/item/clothing/under/pirate(src)
new/obj/item/clothing/suit/pirate(src)
new/obj/item/clothing/head/pirate(src)
new/obj/item/clothing/head/bandana(src)
new/obj/item/clothing/glasses/eyepatch(src)
if(58)
new/obj/item/clothing/under/soviet(src)
new/obj/item/clothing/head/ushanka(src)
if(59)
new/obj/item/clothing/suit/imperium_monk(src)
new/obj/item/clothing/mask/gas/cyborg(src)
if(60)
new/obj/item/clothing/suit/holidaypriest(src)
if(61)
new/obj/item/clothing/head/wizard/marisa/fake(src)
new/obj/item/clothing/suit/wizrobe/marisa/fake(src)
if(62)
new/obj/item/clothing/under/sundress(src)
new/obj/item/clothing/head/witchwig(src)
new/obj/item/weapon/staff/broom(src)
if(63)
new/obj/item/clothing/suit/wizrobe/fake(src)
new/obj/item/clothing/head/wizard/fake(src)
new/obj/item/weapon/staff(src)
if(64)
new/obj/item/clothing/mask/gas/sexyclown(src)
new/obj/item/clothing/under/sexyclown(src)
if(65)
new/obj/item/clothing/mask/gas/sexymime(src)
new/obj/item/clothing/under/sexymime(src)
if(66)
new/obj/item/weapon/stamp/clown(src)
new/obj/item/clothing/mask/gas/clown_hat(src)
new/obj/item/clothing/shoes/clown_shoes(src)
new/obj/item/clothing/under/rank/clown(src)
new/obj/item/weapon/bedsheet/clown(src)
new/obj/item/device/pda/clown(src)
new/obj/item/weapon/storage/backpack/clown(src)
new/obj/item/weapon/bikehorn(src)
// new/obj/item/weapon/reagent_containers/food/snacks/clownburger(src)
new/obj/item/weapon/reagent_containers/food/snacks/grown/banana(src)
new/obj/item/weapon/reagent_containers/food/snacks/pie(src)
new/obj/item/weapon/reagent_containers/food/snacks/sliceable/bananabread(src)
new/obj/item/toy/crayon/rainbow(src)
if(67)
new/obj/item/clothing/mask/gas/mime(src)
new/obj/item/clothing/under/mime(src)
new/obj/item/toy/crayon/mime(src)
new/obj/item/clothing/shoes/mime(src)
new/obj/item/clothing/head/soft/mime(src)
new/obj/item/weapon/bedsheet/mime(src)
new/obj/item/clothing/head/beret(src)
new/obj/item/clothing/suit/suspenders(src)
// new/obj/item/weapon/reagent_containers/food/snacks/egg/mime(src)
new/obj/item/device/pda/mime(src)
// new/obj/item/weapon/reagent_containers/food/drinks/bottle/bottleofnothing(src)
if(68)
new/obj/item/weapon/spacecash/c1000(src)
new/obj/item/weapon/spacecash/c1000(src)
new/obj/item/weapon/spacecash/c1000(src)
new/obj/item/weapon/spacecash/c1000(src)
new/obj/item/weapon/spacecash/c1000(src)
new/obj/item/weapon/spacecash/c1000(src)
new/obj/item/weapon/spacecash/c1000(src)
new/obj/item/weapon/spacecash/c1000(src)
new/obj/item/weapon/spacecash/c1000(src)
if(69)
new/obj/item/pizzabox/margherita(src)
new/obj/item/pizzabox/margherita(src)
new/obj/item/pizzabox/mushroom(src)
new/obj/item/pizzabox/mushroom(src)
new/obj/item/pizzabox/meat(src)
new/obj/item/pizzabox/meat(src)
new/obj/item/pizzabox/vegetable(src)
new/obj/item/pizzabox/vegetable(src)
if(70)
new/obj/machinery/power/supermatter(src)
if(prob(15))
new/obj/item/weapon/spacecash/c500(src)
else
new/obj/item/weapon/spacecash/c1(src)
if(54 to 60)
if(prob(50))
new/obj/item/weapon/ore/strangerock(src)
new/obj/item/weapon/ore/strangerock(src)
new/obj/item/weapon/ore/strangerock(src)
new/obj/item/weapon/ore/slag(src)
new/obj/item/weapon/ore/slag(src)
else
new/obj/item/weapon/ore/gold(src)
new/obj/item/weapon/shard(src)
if(61 to 62)
new/obj/item/weapon/paper/crumpled/bloody(src)
var/gibs = rand(1,4)
switch(gibs)
if(1)
new/obj/item/weapon/organ/r_leg(src)
new/obj/item/weapon/organ/l_arm(src)
if(2)
new/obj/item/weapon/organ/head(src)
new/obj/item/weapon/organ/l_hand(src)
if(3)
new/obj/item/weapon/organ/r_foot(src)
new/obj/item/weapon/organ/r_arm(src)
if(4)
new/obj/item/weapon/organ/l_leg(src)
new/obj/item/weapon/organ/head(src)
//Code modified to make things less boomy, and offer more chances with more difficulty.
/obj/structure/closet/crate/secure/loot/togglelock(mob/user as mob)
if(locked)
user << "<span class='notice'>The crate is locked with a Deca-code lock.</span>"
var/input = input(usr, "Enter digit from [min] to [max].", "Deca-Code Lock", "") as num
// user << "<span class='notice'>The crate is locked with a Deca-code lock.</span>"
// var/input = input(usr, "Enter digit from [min] to [max].", "Deca-Code Lock", "") as num
if(in_range(src, user))
input = Clamp(input, 0, 10)
if (input == code)
user << "<span class='notice'>The crate unlocks!</span>"
locked = 0
overlays.Cut()
overlays += greenlight
else if (input == null || input > max || input < min)
user << "<span class='notice'>You leave the crate alone.</span>"
else
user << "<span class='warning'>A red light flashes.</span>"
lastattempt = input
attempts--
if (attempts == 0)
user << "<span class='danger'>The crate's anti-tamper system activates!</span>"
var/turf/T = get_turf(src.loc)
if (attempts >= 0)
user << "<span class='notice'>The crate is locked with a Deca-code lock.</span>"
var/input = input(usr, "Enter digit from [min] to [max].", "Deca-Code Lock", "") as num
input = Clamp(input, 0, 10)
if (input == code)
user << "<span class='notice'>The crate unlocks!</span>"
locked = 0
overlays.Cut()
overlays += greenlight
else if (input == null || input > max || input < min)
user << "<span class='notice'>You leave the crate alone.</span>"
else
user << "<span class='warning'>A red light flashes.</span>"
lastattempt = input
attempts--
if (attempts == 0)
user << "<span class='danger'>The crate's anti-tamper system will activate after this try, locking the crate down!</span>"
/* var/turf/T = get_turf(src.loc) Coding out the explosion, because I'm nice like that. Don't make me regret this.
explosion(T, 0, 1, 4, 4)
del(src)
return
del(src)*/
// tampered = 1
if (attempts < 0)
user << "<span class='notice'>The crate's anti-tamper system is activated, and the crate is locked down.</span>"
else
user << "<span class='notice'>You attempt to interact with the device using a hand gesture, but it appears this crate is from before the DECANECT came out.</span>"
return
@@ -333,9 +216,9 @@
if (istype(W, /obj/item/device/multitool))
user << "<span class='notice'>DECA-CODE LOCK REPORT:</span>"
if (attempts == 1)
user << "<span class='warning'>* Anti-Tamper Bomb will activate on next failed access attempt.</span>"
user << "<span class='warning'>* Anti-Tamper System will activate on next failed access attempt.</span>"
else
user << "<span class='notice'>* Anti-Tamper Bomb will activate after [src.attempts] failed access attempts.</span>"
user << "<span class='notice'>* Anti-Tamper System will activate after [src.attempts] failed access attempts.</span>"
if (lastattempt == null)
user << "<span class='notice'> has been made to open the crate thus far.</span>"
return
@@ -348,7 +231,24 @@
else ..()
/obj/structure/closet/crate/secure/loot/bullet_act(var/obj/item/projectile/Proj)
var/turf/T = get_turf(src.loc)
explosion(T, 0, 1, 4, 4)
del(src)
return
if(rand(1,7)==1)
var/turf/T = get_turf(src.loc)
explosion(T, 0, 1, 4, 4)
for(var/mob/O in viewers(src, 6))
if((O.client && !( O.blinded )))
O << "<span class='warning'>The crate's anti-tamper system overloads, causing an explosion.</span>"
del(src)
return
// One way of doing this. Let's try another.
// Other way didn't work. Yup.
/* if(health <= 10 && rand(1,5) == 1)
var/turf/T = get_turf(src.loc)
explosion(T, 0, 1, 4, 4)
for(var/mob/O in viewers(user, 6))
if((O.client && !( O.blinded )))
O << "<span class='warning'>The crate's anti-tamper system overloads, causing an explosion.</span>"
viewers << "<span class='warning'>The crate's anti-tamper system overloads, causing an explosion.</span>"
del(src)
return*/