mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-14 08:34:16 +01:00
Improved creature AI and random mob spawning in caves.
Also equipment lockers. Conflicts: code/game/objects/items/weapons/cards_ids.dm code/modules/mining/materials.dm code/modules/mining/mine_turfs.dm code/modules/mining/ores_coins.dm code/modules/mob/living/simple_animal/hostile/mining_mobs.dm code/modules/projectiles/ammunition/bullets.dm code/modules/projectiles/guns/energy/special.dm compare_report_tg.txt icons/obj/device.dmi icons/obj/mining.dmi icons/obj/vehicles.dmi maps/tgstation.2.1.0.0.1.dmm maps/vgstation1.0.0.dmm
This commit is contained in:
@@ -0,0 +1,636 @@
|
||||
/**********************Ore Redemption Unit**************************/
|
||||
//Turns all the various mining machines into a single unit to speed up mining and establish a point system
|
||||
|
||||
/obj/machinery/mineral/ore_redemption
|
||||
name = "ore redemption machine"
|
||||
desc = "A machine that accepts ore and instantly transforms it into workable material sheets, but cannot produce alloys such as Plasteel. Points for ore are generated based on type and can be redeemed at a mining equipment locker."
|
||||
icon = 'icons/obj/machines/mining_machines.dmi'
|
||||
icon_state = "ore_redemption"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
var/obj/machinery/mineral/input = null
|
||||
var/obj/machinery/mineral/output = null
|
||||
req_one_access = list(
|
||||
access_mining_station,
|
||||
access_chemistry,
|
||||
access_bar,
|
||||
access_research,
|
||||
access_ce,
|
||||
access_virology
|
||||
)
|
||||
var/datum/materials/materials = new
|
||||
var/stack_amt = 50; //amount to stack before releasing
|
||||
var/obj/item/weapon/card/id/inserted_id
|
||||
var/points = 0
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/New()
|
||||
spawn( 5 )
|
||||
for (var/dir in cardinal)
|
||||
src.input = locate(/obj/machinery/mineral/input, get_step(src, dir))
|
||||
if(src.input) break
|
||||
for (var/dir in cardinal)
|
||||
src.output = locate(/obj/machinery/mineral/output, get_step(src, dir))
|
||||
if(src.output) break
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/proc/process_sheet(obj/item/weapon/ore/O)
|
||||
var/obj/item/stack/sheet/processed_sheet = SmeltMineral(O)
|
||||
if(processed_sheet)
|
||||
var/datum/material/mat = materials.getMaterial(O.material)
|
||||
mat.stored += processed_sheet.amount //Stack the sheets
|
||||
O.loc = null //Let the old sheet garbage collect
|
||||
while(mat.stored > stack_amt) //Get rid of excessive stackage
|
||||
var/obj/item/stack/sheet/out = new mat.sheettype(output.loc)
|
||||
out.amount = stack_amt-mat.stored
|
||||
mat.stored -= out.amount
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/process()
|
||||
var/turf/T = get_turf(input)
|
||||
if(T)
|
||||
var/obj/item/weapon/ore/O
|
||||
for(O in T)
|
||||
process_sheet(O)
|
||||
for(var/obj/structure/ore_box/B in T)
|
||||
for(O in B.contents)
|
||||
process_sheet(O)
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/proc/SmeltMineral(var/obj/item/weapon/ore/O)
|
||||
if(O.material)
|
||||
var/datum/material/mat = materials.getMaterial(O.material)
|
||||
var/obj/item/stack/sheet/M = new mat.sheettype(src)
|
||||
points += mat.value
|
||||
return M
|
||||
del(O)//No refined type? Purge it.
|
||||
return
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/attack_hand(user as mob)
|
||||
if(..())
|
||||
return
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/interact(mob/user)
|
||||
var/dat
|
||||
|
||||
dat += text("<b>Ore Redemption Machine</b><br><br>")
|
||||
dat += text("This machine only accepts ore. Gibtonite and Slag are not accepted.<br><br>")
|
||||
dat += text("Current unclaimed points: [points]<br>")
|
||||
|
||||
if(istype(inserted_id))
|
||||
dat += text("You have [inserted_id.mining_points] mining points collected. <A href='?src=\ref[src];choice=eject'>Eject ID.</A><br>")
|
||||
dat += text("<A href='?src=\ref[src];choice=claim'>Claim points.</A><br>")
|
||||
else
|
||||
dat += text("No ID inserted. <A href='?src=\ref[src];choice=insert'>Insert ID.</A><br>")
|
||||
|
||||
for(var/O in materials.storage)
|
||||
var/datum/material/mat = materials.getMaterial(O)
|
||||
if(mat.stored > 0)
|
||||
dat += text("[capitalize(mat.processed_name)]: [mat.stored] <A href='?src=\ref[src];release=[mat.id]'>Release</A><br>")
|
||||
|
||||
dat += text("<br>This unit can hold stacks of [stack_amt] sheets of each mineral type.<br><br>")
|
||||
|
||||
dat += text("<HR><b>Mineral Value List:</b><BR>[get_ore_values()]")
|
||||
|
||||
user << browse("[dat]", "window=console_stacking_machine")
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/proc/get_ore_values()
|
||||
var/dat = "<table border='0' width='300'>"
|
||||
for(var/mat_id in materials.storage)
|
||||
var/datum/material/mat = materials.getMaterial(mat_id)
|
||||
dat += "<tr><td>[capitalize(mat.processed_name)]</td><td>[mat.value]</td></tr>"
|
||||
dat += "</table>"
|
||||
return dat
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
if(href_list["choice"])
|
||||
if(istype(inserted_id))
|
||||
if(href_list["choice"] == "eject")
|
||||
inserted_id.loc = loc
|
||||
inserted_id.verb_pickup()
|
||||
inserted_id = null
|
||||
if(href_list["choice"] == "claim")
|
||||
inserted_id.mining_points += points
|
||||
points = 0
|
||||
src << "Points transferred."
|
||||
else if(href_list["choice"] == "insert")
|
||||
var/obj/item/weapon/card/id/I = usr.get_active_hand()
|
||||
if(istype(I))
|
||||
usr.drop_item()
|
||||
I.loc = src
|
||||
inserted_id = I
|
||||
else usr << "\red No valid ID."
|
||||
if(href_list["release"] && istype(inserted_id))
|
||||
if(check_access(inserted_id))
|
||||
var/release=href_list["release"]
|
||||
var/datum/material/mat = materials.getMaterial(release)
|
||||
if(!mat) return
|
||||
var/desired = input("How much?","How much [mat.processed_name] to eject?",mat.stored) as num
|
||||
if(desired==0) return
|
||||
var/obj/item/stack/sheet/out = new mat.sheettype()
|
||||
out.amount = min(mat.stored,desired)
|
||||
mat.stored=desired
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/ex_act()
|
||||
return //So some chucklefuck doesn't ruin miners reward with an explosion
|
||||
|
||||
/**********************Mining Equipment Locker**************************/
|
||||
|
||||
/obj/machinery/mineral/equipment_locker
|
||||
name = "mining equipment locker"
|
||||
desc = "An equipment locker for miners, points collected at an ore redemption machine can be spent here."
|
||||
icon = 'icons/obj/machines/mining_machines.dmi'
|
||||
icon_state = "mining"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
var/obj/item/weapon/card/id/inserted_id
|
||||
var/list/prize_list = list(
|
||||
new /datum/data/mining_equipment("Chili", /obj/item/weapon/reagent_containers/food/snacks/hotchili, 100),
|
||||
new /datum/data/mining_equipment("Cigar", /obj/item/clothing/mask/cigarette/cigar/havana, 100),
|
||||
new /datum/data/mining_equipment("Whiskey", /obj/item/weapon/reagent_containers/food/drinks/bottle/whiskey, 150),
|
||||
new /datum/data/mining_equipment("Soap", /obj/item/weapon/soap/nanotrasen, 150),
|
||||
//new /datum/data/mining_equipment("Stimulant pills", /obj/item/weapon/storage/pill_bottle/stimulant, 350),
|
||||
//new /datum/data/mining_equipment("Alien toy", /obj/item/clothing/mask/facehugger/toy, 250),
|
||||
//new /datum/data/mining_equipment("Laser pointer", /obj/item/device/laser_pointer, 250),
|
||||
new /datum/data/mining_equipment("Point card", /obj/item/weapon/card/mining_point_card, 500),
|
||||
new /datum/data/mining_equipment("Lazarus injector", /obj/item/weapon/lazarus_injector, 1000),
|
||||
new /datum/data/mining_equipment("Space cash", /obj/item/weapon/spacecash/c1000, 5000),
|
||||
new /datum/data/mining_equipment("Sonic jackhammer", /obj/item/weapon/pickaxe/jackhammer, 500),
|
||||
new /datum/data/mining_equipment("Mining drone", /mob/living/simple_animal/hostile/mining_drone/, 500),
|
||||
new /datum/data/mining_equipment("Jaunter", /obj/item/device/wormhole_jaunter, 250),
|
||||
new /datum/data/mining_equipment("Resonator", /obj/item/weapon/resonator, 750),
|
||||
new /datum/data/mining_equipment("Kinetic accelerator", /obj/item/weapon/gun/energy/kinetic_accelerator, 1000),
|
||||
new /datum/data/mining_equipment("Jetpack", /obj/item/weapon/tank/jetpack/carbondioxide, 2000),
|
||||
)
|
||||
|
||||
/datum/data/mining_equipment/
|
||||
var/equipment_name = "generic"
|
||||
var/equipment_path = null
|
||||
var/cost = 0
|
||||
|
||||
/datum/data/mining_equipment/New(name, path, cost)
|
||||
src.equipment_name = name
|
||||
src.equipment_path = path
|
||||
src.cost = cost
|
||||
|
||||
/obj/machinery/mineral/equipment_locker/attack_hand(user as mob)
|
||||
if(..())
|
||||
return
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/mineral/equipment_locker/interact(mob/user)
|
||||
var/dat
|
||||
dat += text("<b>Mining Equipment Locker</b><br><br>")
|
||||
|
||||
if(istype(inserted_id))
|
||||
dat += "You have [inserted_id.mining_points] mining points collected. <A href='?src=\ref[src];choice=eject'>Eject ID.</A><br>"
|
||||
else
|
||||
dat += "No ID inserted. <A href='?src=\ref[src];choice=insert'>Insert ID.</A><br>"
|
||||
|
||||
dat += "<HR><b>Equipment point cost list:</b><BR><table border='0' width='200'>"
|
||||
for(var/datum/data/mining_equipment/prize in prize_list)
|
||||
dat += "<tr><td>[prize.equipment_name]</td><td>[prize.cost]</td><td><A href='?src=\ref[src];purchase=\ref[prize]'>Purchase</A></td></tr>"
|
||||
dat += "</table>"
|
||||
|
||||
user << browse("[dat]", "window=mining_equipment_locker")
|
||||
return
|
||||
|
||||
/obj/machinery/mineral/equipment_locker/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
if(href_list["choice"])
|
||||
if(istype(inserted_id))
|
||||
if(href_list["choice"] == "eject")
|
||||
inserted_id.loc = loc
|
||||
inserted_id.verb_pickup()
|
||||
inserted_id = null
|
||||
else if(href_list["choice"] == "insert")
|
||||
var/obj/item/weapon/card/id/I = usr.get_active_hand()
|
||||
if(istype(I))
|
||||
usr.drop_item()
|
||||
I.loc = src
|
||||
inserted_id = I
|
||||
else usr << "\red No valid ID."
|
||||
if(href_list["purchase"])
|
||||
if(istype(inserted_id))
|
||||
var/datum/data/mining_equipment/prize = locate(href_list["purchase"])
|
||||
if (!prize || !(prize in prize_list))
|
||||
return
|
||||
if(prize.cost > inserted_id.mining_points)
|
||||
else
|
||||
inserted_id.mining_points -= prize.cost
|
||||
new prize.equipment_path(src.loc)
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/mineral/equipment_locker/attackby(obj/item/I as obj, mob/user as mob)
|
||||
if(istype(I, /obj/item/weapon/mining_voucher))
|
||||
RedeemVoucher(I, user)
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/machinery/mineral/equipment_locker/proc/RedeemVoucher(voucher, redeemer)
|
||||
var/selection = input(redeemer, "Pick your equipment", "Mining Voucher Redemption") in list("Resonator kit", "Kinetic Accelerator", "Mining Drone", "Cancel")
|
||||
if(!selection || !Adjacent(redeemer))
|
||||
return
|
||||
switch(selection)
|
||||
if("Resonator kit")
|
||||
new /obj/item/weapon/resonator(src.loc)
|
||||
//new /obj/item/weapon/storage/pill_bottle/stimulant(src.loc)
|
||||
if("Kinetic Accelerator")
|
||||
new /obj/item/weapon/gun/energy/kinetic_accelerator(src.loc)
|
||||
if("Mining Drone")
|
||||
new /mob/living/simple_animal/hostile/mining_drone(src.loc)
|
||||
if("Cancel")
|
||||
return
|
||||
del(voucher)
|
||||
|
||||
/obj/machinery/mineral/equipment_locker/ex_act()
|
||||
return
|
||||
|
||||
/**********************Mining Equipment Locker Items**************************/
|
||||
|
||||
/**********************Mining Equipment Voucher**********************/
|
||||
|
||||
/obj/item/weapon/mining_voucher
|
||||
name = "mining voucher"
|
||||
desc = "A token to redeem a piece of equipment. Use it on a mining equipment locker."
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "mining_voucher"
|
||||
w_class = 1
|
||||
|
||||
/**********************Mining Point Card**********************/
|
||||
|
||||
/obj/item/weapon/card/mining_point_card
|
||||
name = "mining point card"
|
||||
desc = "A small card preloaded with mining points. Swipe your ID card over it to transfer the points, then discard."
|
||||
icon_state = "data"
|
||||
var/points = 500
|
||||
|
||||
/obj/item/weapon/card/mining_point_card/attackby(obj/item/I as obj, mob/user as mob)
|
||||
if(istype(I, /obj/item/weapon/card/id))
|
||||
if(points)
|
||||
var/obj/item/weapon/card/id/C = I
|
||||
C.mining_points += points
|
||||
user << "<span class='info'>You transfer [points] points to [C].</span>"
|
||||
points = 0
|
||||
else
|
||||
user << "<span class='info'>There's no points left on [src].</span>"
|
||||
..()
|
||||
|
||||
/obj/item/weapon/card/mining_point_card/examine()
|
||||
..()
|
||||
usr << "There's [points] points on the card."
|
||||
|
||||
/**********************Jaunter**********************/
|
||||
|
||||
/obj/item/device/wormhole_jaunter
|
||||
name = "wormhole jaunter"
|
||||
desc = "A single use device harnessing outdated wormhole technology, Nanotrasen has since turned its eyes to blue space for more accurate teleportation. The wormholes it creates are unpleasant to travel through, to say the least."
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "Jaunter"
|
||||
item_state = "electronic"
|
||||
throwforce = 0
|
||||
w_class = 2.0
|
||||
throw_speed = 3
|
||||
throw_range = 5
|
||||
origin_tech = "bluespace=2"
|
||||
|
||||
/obj/item/device/wormhole_jaunter/attack_self(mob/user as mob)
|
||||
var/turf/device_turf = get_turf(user)
|
||||
if(!device_turf||device_turf.z==2||device_turf.z>=7)
|
||||
user << "<span class='notice'>You're having difficulties getting the [src.name] to work.</span>"
|
||||
return
|
||||
else
|
||||
user.visible_message("<span class='notice'>[user.name] activates the [src.name]!</span>")
|
||||
var/list/L = list()
|
||||
for(var/obj/item/device/radio/beacon/B in world)
|
||||
var/turf/T = get_turf(B)
|
||||
if(T.z == 1)
|
||||
L += B
|
||||
if(!L.len)
|
||||
user << "<span class='notice'>The [src.name] failed to create a wormhole.</span>"
|
||||
return
|
||||
var/chosen_beacon = pick(L)
|
||||
var/obj/effect/portal/wormhole/jaunt_tunnel/J = new /obj/effect/portal/wormhole/jaunt_tunnel(get_turf(src), chosen_beacon, lifespan=100)
|
||||
J.target = chosen_beacon
|
||||
try_move_adjacent(J)
|
||||
playsound(src,'sound/effects/sparks4.ogg',50,1)
|
||||
del(src)
|
||||
|
||||
/obj/effect/portal/wormhole/jaunt_tunnel
|
||||
name = "jaunt tunnel"
|
||||
icon = 'icons/effects/effects.dmi'
|
||||
icon_state = "bhole3"
|
||||
desc = "A stable hole in the universe made by a wormhole jaunter. Turbulent doesn't even begin to describe how rough passage through one of these is, but at least it will always get you somewhere near a beacon."
|
||||
|
||||
/obj/effect/portal/wormhole/jaunt_tunnel/teleport(atom/movable/M)
|
||||
if(istype(M, /obj/effect))
|
||||
return
|
||||
if(istype(M, /atom/movable))
|
||||
do_teleport(M, target, 6)
|
||||
if(isliving(M))
|
||||
var/mob/living/L = M
|
||||
L.Weaken(3)
|
||||
if(ishuman(L))
|
||||
shake_camera(L, 20, 1)
|
||||
spawn(20)
|
||||
L.visible_message("<span class='danger'>[L.name] vomits from travelling through the [src.name]!</span>")
|
||||
L.nutrition -= 20
|
||||
L.adjustToxLoss(-3)
|
||||
var/turf/T = get_turf(L)
|
||||
T.add_vomit_floor(L)
|
||||
playsound(L, 'sound/effects/splat.ogg', 50, 1)
|
||||
|
||||
/**********************Resonator**********************/
|
||||
|
||||
/obj/item/weapon/resonator
|
||||
name = "resonator"
|
||||
icon = 'icons/obj/items.dmi'
|
||||
icon_state = "resonator"
|
||||
item_state = "resonator"
|
||||
desc = "A handheld device that creates small fields of energy that resonate until they detonate, crushing rock. It can also be activated without a target to create a field at the user's location, to act as a delayed time trap. It's more effective in a vaccuum."
|
||||
w_class = 3
|
||||
force = 10
|
||||
throwforce = 10
|
||||
var/cooldown = 0
|
||||
|
||||
/obj/item/weapon/resonator/proc/CreateResonance(var/target, var/creator)
|
||||
if(cooldown <= 0)
|
||||
playsound(src,'sound/effects/stealthoff.ogg',50,1)
|
||||
var/obj/effect/resonance/R = new /obj/effect/resonance(get_turf(target))
|
||||
R.creator = creator
|
||||
cooldown = 1
|
||||
spawn(20)
|
||||
cooldown = 0
|
||||
|
||||
/obj/item/weapon/resonator/attack_self(mob/user as mob)
|
||||
CreateResonance(src, user)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/resonator/afterattack(atom/target, mob/user, proximity_flag)
|
||||
if(target in user.contents)
|
||||
return
|
||||
if(proximity_flag)
|
||||
CreateResonance(target, user)
|
||||
|
||||
/obj/effect/resonance
|
||||
name = "resonance field"
|
||||
desc = "A resonating field that significantly damages anything inside of it when the field eventually ruptures."
|
||||
icon = 'icons/effects/effects.dmi'
|
||||
icon_state = "shield1"
|
||||
layer = 4.1
|
||||
mouse_opacity = 0
|
||||
var/resonance_damage = 30
|
||||
var/creator = null
|
||||
|
||||
/obj/effect/resonance/New()
|
||||
var/turf/proj_turf = get_turf(src)
|
||||
if(!istype(proj_turf))
|
||||
return
|
||||
if(istype(proj_turf, /turf/simulated/mineral))
|
||||
var/turf/simulated/mineral/M = proj_turf
|
||||
playsound(src,'sound/effects/sparks4.ogg',50,1)
|
||||
M.GetDrilled()
|
||||
spawn(5)
|
||||
del(src)
|
||||
else
|
||||
var/datum/gas_mixture/environment = proj_turf.return_air()
|
||||
var/pressure = environment.return_pressure()
|
||||
if(pressure < 50)
|
||||
name = "strong resonance field"
|
||||
resonance_damage = 60
|
||||
spawn(50)
|
||||
playsound(src,'sound/effects/sparks4.ogg',50,1)
|
||||
if(creator)
|
||||
for(var/mob/living/L in src.loc)
|
||||
add_logs(creator, L, "used a resonator field on", object="resonator")
|
||||
L << "<span class='danger'>The [src.name] ruptured with you in it!</span>"
|
||||
L.adjustBruteLoss(resonance_damage)
|
||||
else
|
||||
for(var/mob/living/L in src.loc)
|
||||
L << "<span class='danger'>The [src.name] ruptured with you in it!</span>"
|
||||
L.adjustBruteLoss(resonance_damage)
|
||||
del(src)
|
||||
|
||||
/**********************Mining drone**********************/
|
||||
|
||||
/mob/living/simple_animal/hostile/mining_drone/
|
||||
name = "nanotrasen minebot"
|
||||
desc = "A small robot used to support miners, can be set to search and collect loose ore, or to help fend off wildlife."
|
||||
icon = 'icons/obj/aibots.dmi'
|
||||
icon_state = "mining_drone"
|
||||
icon_living = "mining_drone"
|
||||
status_flags = CANSTUN|CANWEAKEN|CANPUSH
|
||||
mouse_opacity = 1
|
||||
faction = "neutral"
|
||||
a_intent = "harm"
|
||||
min_oxy = 0
|
||||
max_oxy = 0
|
||||
min_tox = 0
|
||||
max_tox = 0
|
||||
min_co2 = 0
|
||||
max_co2 = 0
|
||||
min_n2 = 0
|
||||
max_n2 = 0
|
||||
minbodytemp = 0
|
||||
wander = 0
|
||||
idle_vision_range = 5
|
||||
move_to_delay = 10
|
||||
retreat_distance = 1
|
||||
minimum_distance = 2
|
||||
health = 100
|
||||
maxHealth = 100
|
||||
melee_damage_lower = 15
|
||||
melee_damage_upper = 15
|
||||
environment_smash = 0
|
||||
attacktext = "drills"
|
||||
attack_sound = 'sound/weapons/circsawhit.ogg'
|
||||
ranged = 1
|
||||
ranged_message = "shoots"
|
||||
ranged_cooldown_cap = 3
|
||||
projectiletype = /obj/item/projectile/beam
|
||||
projectilesound = 'sound/weapons/Laser.ogg'
|
||||
wanted_objects = list(/obj/item/weapon/ore)
|
||||
|
||||
/mob/living/simple_animal/hostile/mining_drone/attackby(obj/item/I as obj, mob/user as mob)
|
||||
if(istype(I, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/W = I
|
||||
if(W.welding && !stat)
|
||||
if(stance != HOSTILE_STANCE_IDLE)
|
||||
user << "<span class='info'>[src] is moving around too much to repair!</span>"
|
||||
return
|
||||
if(maxHealth == health)
|
||||
user << "<span class='info'>[src] is at full integrity.</span>"
|
||||
else
|
||||
health += 10
|
||||
user << "<span class='info'>You repair some of the armor on [src].</span>"
|
||||
return
|
||||
if(istype(I, /obj/item/device/mining_scanner))
|
||||
user << "<span class='info'>You instruct [src] to drop any collected ore.</span>"
|
||||
DropOre()
|
||||
return
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/hostile/mining_drone/Die()
|
||||
..()
|
||||
visible_message("<span class='danger'>[src] is destroyed!</span>")
|
||||
new /obj/effect/decal/remains/robot(src.loc)
|
||||
DropOre()
|
||||
del src
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/hostile/mining_drone/New()
|
||||
..()
|
||||
SetCollectBehavior()
|
||||
|
||||
/mob/living/simple_animal/hostile/mining_drone/attack_hand(mob/living/carbon/human/M)
|
||||
if(M.a_intent == "help")
|
||||
switch(search_objects)
|
||||
if(0)
|
||||
SetCollectBehavior()
|
||||
M << "<span class='info'>[src] has been set to search and store loose ore.</span>"
|
||||
if(2)
|
||||
SetOffenseBehavior()
|
||||
M << "<span class='info'>[src] has been set to attack hostile wildlife.</span>"
|
||||
return
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/hostile/mining_drone/proc/SetCollectBehavior()
|
||||
stop_automated_movement_when_pulled = 1
|
||||
idle_vision_range = 9
|
||||
search_objects = 2
|
||||
wander = 1
|
||||
ranged = 0
|
||||
minimum_distance = 1
|
||||
retreat_distance = null
|
||||
icon_state = "mining_drone"
|
||||
|
||||
/mob/living/simple_animal/hostile/mining_drone/proc/SetOffenseBehavior()
|
||||
stop_automated_movement_when_pulled = 0
|
||||
idle_vision_range = 5
|
||||
search_objects = 0
|
||||
wander = 0
|
||||
ranged = 1
|
||||
retreat_distance = 1
|
||||
minimum_distance = 2
|
||||
icon_state = "mining_drone_offense"
|
||||
|
||||
/mob/living/simple_animal/hostile/mining_drone/AttackingTarget()
|
||||
if(istype(target, /obj/item/weapon/ore))
|
||||
CollectOre()
|
||||
return
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/hostile/mining_drone/proc/CollectOre()
|
||||
var/obj/item/weapon/ore/O
|
||||
for(O in src.loc)
|
||||
O.loc = src
|
||||
for(var/dir in alldirs)
|
||||
var/turf/T = get_step(src,dir)
|
||||
for(O in T)
|
||||
O.loc = src
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/hostile/mining_drone/proc/DropOre()
|
||||
if(!contents.len)
|
||||
return
|
||||
for(var/obj/item/weapon/ore/O in contents)
|
||||
contents -= O
|
||||
O.loc = src.loc
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/hostile/mining_drone/adjustBruteLoss()
|
||||
if(search_objects)
|
||||
SetOffenseBehavior()
|
||||
..()
|
||||
|
||||
/**********************Lazarus Injector**********************/
|
||||
|
||||
/obj/item/weapon/lazarus_injector
|
||||
name = "lazarus injector"
|
||||
desc = "An injector with a cocktail of nanomachines and chemicals, this device can seemingly raise animals from the dead, making them become friendly to the user. Unfortunately, the process is useless on higher forms of life and incredibly costly, so these were hidden in storage until an executive thought they'd be great motivation for some of their employees."
|
||||
icon = 'icons/obj/syringe.dmi'
|
||||
icon_state = "lazarus_hypo"
|
||||
item_state = "hypo"
|
||||
throwforce = 0
|
||||
w_class = 2.0
|
||||
throw_speed = 3
|
||||
throw_range = 5
|
||||
var/loaded = 1
|
||||
|
||||
/obj/item/weapon/lazarus_injector/afterattack(atom/target, mob/user, proximity_flag)
|
||||
if(!loaded)
|
||||
return
|
||||
if(istype(target, /mob/living) && proximity_flag)
|
||||
if(istype(target, /mob/living/simple_animal))
|
||||
var/mob/living/simple_animal/M = target
|
||||
if(M.stat == DEAD)
|
||||
M.faction = "lazarus"
|
||||
M.revive()
|
||||
if(istype(target, /mob/living/simple_animal/hostile))
|
||||
var/mob/living/simple_animal/hostile/H = M
|
||||
H.friends += user
|
||||
log_game("[user] has revived hostile mob [target] with a lazarus injector")
|
||||
loaded = 0
|
||||
user.visible_message("<span class='notice'>[user] injects [M] with [src], reviving it.</span>")
|
||||
playsound(src,'sound/effects/refill.ogg',50,1)
|
||||
icon_state = "lazarus_empty"
|
||||
return
|
||||
else
|
||||
user << "<span class='info'>[src] is only effective on the dead.</span>"
|
||||
return
|
||||
else
|
||||
user << "<span class='info'>[src] is only effective on lesser beings.</span>"
|
||||
return
|
||||
|
||||
/obj/item/weapon/lazarus_injector/examine()
|
||||
..()
|
||||
if(!loaded)
|
||||
usr << "<span class='info'>[src] is empty.</span>"
|
||||
|
||||
/**********************Mining Scanner**********************/
|
||||
/obj/item/device/mining_scanner
|
||||
desc = "A scanner that checks surrounding rock for useful minerals, it can also be used to stop gibtonite detonations. Requires you to wear mesons to work properly."
|
||||
name = "mining scanner"
|
||||
icon_state = "mining"
|
||||
item_state = "analyzer"
|
||||
w_class = 2.0
|
||||
flags = CONDUCT
|
||||
slot_flags = SLOT_BELT
|
||||
var/cooldown = 0
|
||||
|
||||
/obj/item/device/mining_scanner/attack_self(mob/user)
|
||||
if(!user.client)
|
||||
return
|
||||
if(!cooldown)
|
||||
cooldown = 1
|
||||
spawn(40)
|
||||
cooldown = 0
|
||||
var/client/C = user.client
|
||||
var/list/L = list()
|
||||
var/turf/simulated/mineral/M
|
||||
for(M in range(7, user))
|
||||
if(M.scan_state)
|
||||
L += M
|
||||
if(!L.len)
|
||||
user << "<span class='info'>[src] reports that nothing was detected nearby.</span>"
|
||||
return
|
||||
else
|
||||
for(M in L)
|
||||
var/turf/T = get_turf(M)
|
||||
var/image/I = image('icons/turf/walls.dmi', loc = T, icon_state = M.scan_state, layer = 18)
|
||||
C.images += I
|
||||
spawn(30)
|
||||
if(C)
|
||||
C.images -= I
|
||||
|
||||
/**********************Xeno Warning Sign**********************/
|
||||
/obj/structure/sign/xeno_warning_mining
|
||||
name = "DANGEROUS ALIEN LIFE"
|
||||
desc = "A sign that warns would be travellers of hostile alien life in the vicinity."
|
||||
icon = 'icons/obj/mining.dmi'
|
||||
icon_state = "xeno_warning"
|
||||
@@ -0,0 +1,139 @@
|
||||
/**
|
||||
* Materials system
|
||||
*
|
||||
* Replaces all of the horrible variables that tracked each individual thing.
|
||||
*/
|
||||
|
||||
/**
|
||||
* MATERIALS DATUM
|
||||
*
|
||||
* Tracks and manages material storage for an object.
|
||||
*/
|
||||
/datum/materials
|
||||
var/list/datum/material/storage[0]
|
||||
|
||||
/datum/materials/New()
|
||||
for(var/matdata in typesof(/datum/material) - /datum/material)
|
||||
var/datum/material/mat = new matdata
|
||||
storage[mat.id]=mat
|
||||
|
||||
/datum/materials/proc/addAmount(var/mat_id,var/amount)
|
||||
if(!(mat_id in storage))
|
||||
warning("addAmount(): Unknown material [mat_id]!")
|
||||
return
|
||||
// I HATE BYOND
|
||||
// storage[mat_id].stored++
|
||||
var/datum/material/mat=storage[mat_id]
|
||||
mat.stored += amount
|
||||
storage[mat_id]=mat
|
||||
|
||||
/datum/materials/proc/removeAmount(var/mat_id,var/amount)
|
||||
if(!(mat_id in storage))
|
||||
warning("removeAmount(): Unknown material [mat_id]!")
|
||||
return
|
||||
addAmount(mat_id,-amount)
|
||||
|
||||
/datum/materials/proc/getAmount(var/mat_id)
|
||||
if(!(mat_id in storage))
|
||||
warning("getAmount(): Unknown material [mat_id]!")
|
||||
return 0
|
||||
|
||||
var/datum/material/mat=getMaterial(mat_id)
|
||||
return mat.stored
|
||||
|
||||
/datum/materials/proc/getMaterial(var/mat_id)
|
||||
if(!(mat_id in storage))
|
||||
warning("getMaterial(): Unknown material [mat_id]!")
|
||||
return 0
|
||||
|
||||
return storage[mat_id]
|
||||
|
||||
|
||||
/datum/material
|
||||
var/name=""
|
||||
var/processed_name=""
|
||||
var/id=""
|
||||
var/stored=0
|
||||
var/cc_per_sheet=CC_PER_SHEET_MISC
|
||||
var/oretype=null
|
||||
var/sheettype=null
|
||||
var/cointype=null
|
||||
var/value=0
|
||||
|
||||
/datum/material/New()
|
||||
if(processed_name=="")
|
||||
processed_name=name
|
||||
|
||||
/datum/material/iron
|
||||
name="Iron"
|
||||
id="iron"
|
||||
value=1
|
||||
cc_per_sheet=CC_PER_SHEET_METAL
|
||||
oretype=/obj/item/weapon/ore/iron
|
||||
sheettype=/obj/item/stack/sheet/metal
|
||||
cointype=/obj/item/weapon/coin/iron
|
||||
|
||||
/datum/material/glass
|
||||
name="Sand"
|
||||
processed_name="Glass"
|
||||
id="glass"
|
||||
value=1
|
||||
cc_per_sheet=CC_PER_SHEET_GLASS
|
||||
oretype=/obj/item/weapon/ore/glass
|
||||
sheettype=/obj/item/stack/sheet/glass
|
||||
|
||||
/datum/material/diamond
|
||||
name="Diamond"
|
||||
id="diamond"
|
||||
value=40
|
||||
oretype=/obj/item/weapon/ore/diamond
|
||||
sheettype=/obj/item/stack/sheet/mineral/diamond
|
||||
cointype=/obj/item/weapon/coin/diamond
|
||||
|
||||
/datum/material/plasma
|
||||
name="Plasma"
|
||||
id="plasma"
|
||||
value=40
|
||||
oretype=/obj/item/weapon/ore/plasma
|
||||
sheettype=/obj/item/stack/sheet/mineral/plasma
|
||||
cointype=/obj/item/weapon/coin/plasma
|
||||
|
||||
/datum/material/gold
|
||||
name="Gold"
|
||||
id="gold"
|
||||
value=20
|
||||
oretype=/obj/item/weapon/ore/gold
|
||||
sheettype=/obj/item/stack/sheet/mineral/gold
|
||||
cointype=/obj/item/weapon/coin/gold
|
||||
|
||||
/datum/material/silver
|
||||
name="Silver"
|
||||
id="silver"
|
||||
value=20
|
||||
oretype=/obj/item/weapon/ore/silver
|
||||
sheettype=/obj/item/stack/sheet/mineral/silver
|
||||
cointype=/obj/item/weapon/coin/silver
|
||||
|
||||
/datum/material/uranium
|
||||
name="Uranium"
|
||||
id="uranium"
|
||||
value=20
|
||||
oretype=/obj/item/weapon/ore/uranium
|
||||
sheettype=/obj/item/stack/sheet/mineral/uranium
|
||||
cointype=/obj/item/weapon/coin/uranium
|
||||
|
||||
/datum/material/clown
|
||||
name="Bananium"
|
||||
id="clown"
|
||||
value=100
|
||||
oretype=/obj/item/weapon/ore/clown
|
||||
sheettype=/obj/item/stack/sheet/mineral/clown
|
||||
cointype=/obj/item/weapon/coin/clown
|
||||
|
||||
/datum/material/plastic
|
||||
name="Plastic"
|
||||
id="plastic"
|
||||
value=1
|
||||
oretype=null
|
||||
sheettype=/obj/item/stack/sheet/mineral/plastic
|
||||
cointype=null
|
||||
@@ -26,6 +26,7 @@ var/list/artifact_spawn = list() // Runtime fix for geometry loading before cont
|
||||
var/excav_overlay = ""
|
||||
var/obj/item/weapon/last_find
|
||||
var/datum/artifact_find/artifact_find
|
||||
var/scan_state = null
|
||||
|
||||
|
||||
New()
|
||||
@@ -104,10 +105,13 @@ var/list/artifact_spawn = list() // Runtime fix for geometry loading before cont
|
||||
switch(mineral.display_name)
|
||||
if("Iron")
|
||||
icon_state = "rock_Iron[rand(1,3)]"
|
||||
scan_state = "rock_Iron"
|
||||
if("Plasma")
|
||||
icon_state = "rock_Plasma[rand(1,3)]"
|
||||
scan_state = "rock_Plasma"
|
||||
else
|
||||
icon_state = "rock_[mineral.name]"
|
||||
scan_state = "rock_[mineral.name]"
|
||||
|
||||
//Not even going to touch this pile of spaghetti
|
||||
attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
@@ -565,9 +569,9 @@ var/list/artifact_spawn = list() // Runtime fix for geometry loading before cont
|
||||
////////////////////////////////Gibtonite
|
||||
/turf/simulated/mineral/gibtonite
|
||||
name = "Diamond deposit" //honk
|
||||
icon_state = "rock_Diamond"
|
||||
icon_state = "rock_Gibtonite"
|
||||
mineral = new /mineral/gibtonite
|
||||
|
||||
scan_state = "rock_Gibtonite"
|
||||
var/det_time = 8 //Countdown till explosion, but also rewards the player for how close you were to detonation when you defuse it
|
||||
var/stage = 0 //How far into the lifecycle of gibtonite we are, 0 is untouched, 1 is active and attempting to detonate, 2 is benign and ready for extraction
|
||||
var/activated_ckey = null //These are to track who triggered the gibtonite deposit for logging purposes
|
||||
@@ -648,6 +652,13 @@ var/list/artifact_spawn = list() // Runtime fix for geometry loading before cont
|
||||
|
||||
/turf/simulated/floor/plating/airless/asteroid/cave
|
||||
var/length = 100
|
||||
var/mob_spawn_list = list(
|
||||
/mob/living/simple_animal/hostile/asteroid/goliath = 5,
|
||||
/mob/living/simple_animal/hostile/asteroid/goldgrub = 1,
|
||||
/mob/living/simple_animal/hostile/asteroid/basilisk = 3,
|
||||
/mob/living/simple_animal/hostile/asteroid/hivelord = 5
|
||||
)
|
||||
var/sanity = 1
|
||||
|
||||
/turf/simulated/floor/plating/airless/asteroid/cave/New(loc, var/length, var/go_backwards = 1, var/exclude_dir = -1)
|
||||
|
||||
@@ -676,6 +687,8 @@ var/list/artifact_spawn = list() // Runtime fix for geometry loading before cont
|
||||
var/next_angle = pick(45, -45)
|
||||
|
||||
for(var/i = 0; i < length; i++)
|
||||
if(!sanity)
|
||||
break
|
||||
|
||||
var/list/L = list(45)
|
||||
if(IsOdd(dir2angle(dir))) // We're going at an angle and we want thick angled tunnels.
|
||||
@@ -707,7 +720,23 @@ var/list/artifact_spawn = list() // Runtime fix for geometry loading before cont
|
||||
|
||||
|
||||
/turf/simulated/floor/plating/airless/asteroid/cave/proc/SpawnFloor(var/turf/T)
|
||||
//var/turf/simulated/floor/t =
|
||||
new /turf/simulated/floor/plating/airless/asteroid(T)
|
||||
//spawn(2)
|
||||
// t.fullUpdateMineralOverlays()
|
||||
for(var/turf/S in range(2,T))
|
||||
if(istype(S, /turf/space) || istype(S.loc, /area/mine/explored))
|
||||
sanity = 0
|
||||
break
|
||||
if(!sanity)
|
||||
return
|
||||
|
||||
SpawnMonster(T)
|
||||
|
||||
|
||||
/turf/simulated/floor/plating/airless/asteroid/cave/proc/SpawnMonster(var/turf/T)
|
||||
if(prob(2))
|
||||
if(istype(loc, /area/mine/explored))
|
||||
return
|
||||
for(var/atom/A in range(7,T))//Lowers chance of mob clumps
|
||||
if(istype(A, /mob/living/simple_animal/hostile/asteroid))
|
||||
return
|
||||
var/randumb = pickweight(mob_spawn_list)
|
||||
new randumb(T)
|
||||
return
|
||||
|
||||
@@ -4,22 +4,26 @@
|
||||
name = "Rock"
|
||||
icon = 'icons/obj/mining.dmi'
|
||||
icon_state = "ore2"
|
||||
var/material=null
|
||||
var/datum/geosample/geologic_data
|
||||
|
||||
/obj/item/weapon/ore/uranium
|
||||
name = "Uranium ore"
|
||||
icon_state = "Uranium ore"
|
||||
origin_tech = "materials=5"
|
||||
material="uranium"
|
||||
|
||||
/obj/item/weapon/ore/iron
|
||||
name = "Iron ore"
|
||||
icon_state = "Iron ore"
|
||||
origin_tech = "materials=1"
|
||||
material="iron"
|
||||
|
||||
/obj/item/weapon/ore/glass
|
||||
name = "Sand"
|
||||
icon_state = "Glass ore"
|
||||
origin_tech = "materials=1"
|
||||
material="glass"
|
||||
|
||||
attack_self(mob/living/user as mob) //It's magic I ain't gonna explain how instant conversion with no tool works. -- Urist
|
||||
var/location = get_turf(user)
|
||||
@@ -33,26 +37,31 @@
|
||||
name = "Plasma ore"
|
||||
icon_state = "Plasma ore"
|
||||
origin_tech = "materials=2"
|
||||
material="plasma"
|
||||
|
||||
/obj/item/weapon/ore/silver
|
||||
name = "Silver ore"
|
||||
icon_state = "Silver ore"
|
||||
origin_tech = "materials=3"
|
||||
material="silver"
|
||||
|
||||
/obj/item/weapon/ore/gold
|
||||
name = "Gold ore"
|
||||
icon_state = "Gold ore"
|
||||
origin_tech = "materials=4"
|
||||
material="gold"
|
||||
|
||||
/obj/item/weapon/ore/diamond
|
||||
name = "Diamond ore"
|
||||
icon_state = "Diamond ore"
|
||||
origin_tech = "materials=6"
|
||||
material="diamond"
|
||||
|
||||
/obj/item/weapon/ore/clown
|
||||
name = "Bananium ore"
|
||||
icon_state = "Clown ore"
|
||||
origin_tech = "materials=4"
|
||||
material="clown"
|
||||
|
||||
/obj/item/weapon/ore/slag
|
||||
name = "Slag"
|
||||
@@ -73,19 +82,45 @@
|
||||
var/quality = 1 //How pure this gibtonite is, determines the explosion produced by it and is derived from the det_time of the rock wall it was taken from, higher value = better
|
||||
|
||||
/obj/item/weapon/twohanded/required/gibtonite/attackby(obj/item/I, mob/user)
|
||||
if(istype(I, /obj/item/weapon/pickaxe) && !primed)
|
||||
if(istype(I, /obj/item/weapon/pickaxe) || istype(I, /obj/item/weapon/resonator))
|
||||
GibtoniteReaction(user)
|
||||
return
|
||||
if(istype(I, /obj/item/device/mining_scanner) && primed)
|
||||
primed = 0
|
||||
user.visible_message("<span class='notice'>The chain reaction was stopped! ...The ore's quality went down.</span>")
|
||||
icon_state = "Gibtonite ore"
|
||||
quality = 1
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/weapon/twohanded/required/gibtonite/bullet_act(var/obj/item/projectile/P)
|
||||
if(istype(P, /obj/item/projectile/bullet))
|
||||
GibtoniteReaction(P.firer)
|
||||
..()
|
||||
|
||||
/obj/item/weapon/twohanded/required/gibtonite/ex_act()
|
||||
GibtoniteReaction(triggered_by_explosive = 1)
|
||||
|
||||
/obj/item/weapon/twohanded/required/gibtonite/proc/GibtoniteReaction(mob/user, triggered_by_explosive = 0)
|
||||
if(!primed)
|
||||
playsound(src,'sound/effects/hit_on_shattered_glass.ogg',50,1)
|
||||
primed = 1
|
||||
icon_state = "Gibtonite active"
|
||||
user.visible_message("<span class='warning'>[user] strikes the [src], causing a chain reaction!</span>")
|
||||
var/turf/bombturf = get_turf(src)
|
||||
var/area/A = get_area(bombturf)
|
||||
var/notify_admins = 0
|
||||
if(z != 5)//Only annoy the admins ingame if we're triggered off the mining zlevel
|
||||
notify_admins = 1
|
||||
if(notify_admins)
|
||||
message_admins("[key_name(usr)]<A HREF='?_src_=holder;adminmoreinfo=\ref[usr]'>?</A> has triggered a [name] to detonate at <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[bombturf.x];Y=[bombturf.y];Z=[bombturf.z]'>[A.name] (JMP)</a>.")
|
||||
log_game("[key_name(usr)] has primed a [name] for detonation at [A.name]([bombturf.x],[bombturf.y],[bombturf.z])")
|
||||
if(triggered_by_explosive)
|
||||
message_admins("An explosion has triggered a [name] to detonate at <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[bombturf.x];Y=[bombturf.y];Z=[bombturf.z]'>[A.name] (JMP)</a>.")
|
||||
else
|
||||
message_admins("[key_name(usr)]<A HREF='?_src_=holder;adminmoreinfo=\ref[usr]'>?</A> has triggered a [name] to detonate at <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[bombturf.x];Y=[bombturf.y];Z=[bombturf.z]'>[A.name] (JMP)</a>.")
|
||||
if(triggered_by_explosive)
|
||||
log_game("An explosion has primed a [name] for detonation at [A.name]([bombturf.x],[bombturf.y],[bombturf.z])")
|
||||
else
|
||||
user.visible_message("<span class='warning'>[user] strikes the [src], causing a chain reaction!</span>")
|
||||
log_game("[key_name(usr)] has primed a [name] for detonation at [A.name]([bombturf.x],[bombturf.y],[bombturf.z])")
|
||||
spawn(det_time)
|
||||
if(primed)
|
||||
if(quality == 3)
|
||||
@@ -95,17 +130,14 @@
|
||||
if(quality == 1)
|
||||
explosion(src.loc,-1,1,3,adminlog = notify_admins)
|
||||
del(src)
|
||||
if(istype(I, /obj/item/device/analyzer) && primed)
|
||||
primed = 0
|
||||
user.visible_message("<span class='notice'>The chain reaction was stopped! ...The ore's quality went down.</span>")
|
||||
icon_state = "Gibtonite ore"
|
||||
quality = 1
|
||||
..()
|
||||
|
||||
/obj/item/weapon/ore/New()
|
||||
pixel_x = rand(0,16)-8
|
||||
pixel_y = rand(0,8)-8
|
||||
|
||||
/obj/item/weapon/ore/ex_act()
|
||||
return
|
||||
|
||||
/obj/item/weapon/ore/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W,/obj/item/device/core_sampler))
|
||||
var/obj/item/device/core_sampler/C = W
|
||||
|
||||
Reference in New Issue
Block a user