mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-29 19:43:16 +00:00
new icons, added some large artifacts, renamed/restructured a bunch of files
Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
This commit is contained in:
@@ -1 +0,0 @@
|
||||
//todo: tape, methods for excavation?
|
||||
87
code/modules/research/xenoarchaeology/artifact_autocloner.dm
Normal file
87
code/modules/research/xenoarchaeology/artifact_autocloner.dm
Normal file
@@ -0,0 +1,87 @@
|
||||
|
||||
/obj/machinery/auto_cloner
|
||||
name = "mysterious pod"
|
||||
desc = "It's full of a viscous liquid, but appears dark and silent."
|
||||
icon = 'icons/obj/cryogenics.dmi'
|
||||
icon_state = "cellold0"
|
||||
var/spawn_type
|
||||
var/current_ticks_spawning = 0
|
||||
var/ticks_required_to_spawn
|
||||
density = 1
|
||||
var/previous_power_state = 0
|
||||
|
||||
use_power = 1
|
||||
active_power_usage = 2000
|
||||
idle_power_usage = 1000
|
||||
|
||||
/obj/machinery/auto_cloner/New()
|
||||
..()
|
||||
|
||||
ticks_required_to_spawn = rand(240,1440)
|
||||
|
||||
//33% chance to spawn nasties
|
||||
if(prob(33))
|
||||
spawn_type = pick(\
|
||||
/mob/living/simple_animal/hostile/giant_spider/nurse,\
|
||||
/mob/living/simple_animal/hostile/alien,\
|
||||
/mob/living/simple_animal/hostile/bear,\
|
||||
/mob/living/simple_animal/hostile/creature,\
|
||||
/mob/living/simple_animal/hostile/panther,\
|
||||
/mob/living/simple_animal/hostile/snake\
|
||||
)
|
||||
else
|
||||
spawn_type = pick(\
|
||||
/mob/living/simple_animal/cat,\
|
||||
/mob/living/simple_animal/corgi,\
|
||||
/mob/living/simple_animal/corgi/puppy,\
|
||||
/mob/living/simple_animal/chicken,\
|
||||
/mob/living/simple_animal/cow,\
|
||||
/mob/living/simple_animal/parrot,\
|
||||
/mob/living/simple_animal/slime,\
|
||||
/mob/living/simple_animal/crab,\
|
||||
/mob/living/simple_animal/mouse,\
|
||||
/mob/living/simple_animal/hostile/retaliate/goat,\
|
||||
/mob/living/carbon/monkey\
|
||||
)
|
||||
|
||||
//todo: how the hell is the asteroid permanently powered?
|
||||
/obj/machinery/auto_cloner/process()
|
||||
if(powered(power_channel))
|
||||
if(!previous_power_state)
|
||||
previous_power_state = 1
|
||||
icon_state = "cellold1"
|
||||
src.visible_message("\blue \icon[src] [src] suddenly comes to life!")
|
||||
|
||||
//slowly grow a mob
|
||||
current_ticks_spawning++
|
||||
if(prob(5))
|
||||
src.visible_message("\blue \icon[src] [src] [pick("gloops","glugs","whirrs","whooshes","hisses","purrs","hums","gushes")].")
|
||||
|
||||
//if we've finished growing...
|
||||
if(current_ticks_spawning >= ticks_required_to_spawn)
|
||||
current_ticks_spawning = 0
|
||||
use_power = 1
|
||||
src.visible_message("\blue \icon[src] [src] pings!")
|
||||
icon_state = "cellold1"
|
||||
desc = "It's full of a bubbling viscous liquid, and is lit by a mysterious glow."
|
||||
if(spawn_type)
|
||||
new spawn_type(src.loc)
|
||||
|
||||
//if we're getting close to finished, kick into overdrive power usage
|
||||
if(current_ticks_spawning / ticks_required_to_spawn > 0.75)
|
||||
use_power = 2
|
||||
icon_state = "cellold2"
|
||||
desc = "It's full of a bubbling viscous liquid, and is lit by a mysterious glow. A dark shape appears to be forming inside..."
|
||||
else
|
||||
use_power = 1
|
||||
icon_state = "cellold1"
|
||||
desc = "It's full of a bubbling viscous liquid, and is lit by a mysterious glow."
|
||||
else
|
||||
if(previous_power_state)
|
||||
previous_power_state = 0
|
||||
icon_state = "cellold0"
|
||||
src.visible_message("\blue \icon[src] [src] suddenly shuts down.")
|
||||
|
||||
//cloned mob slowly breaks down
|
||||
if(current_ticks_spawning > 0)
|
||||
current_ticks_spawning--
|
||||
35
code/modules/research/xenoarchaeology/artifact_gigadrill.dm
Normal file
35
code/modules/research/xenoarchaeology/artifact_gigadrill.dm
Normal file
@@ -0,0 +1,35 @@
|
||||
|
||||
/obj/machinery/giga_drill
|
||||
name = "alien drill"
|
||||
desc = "A giant, alien drill mounted on long treads."
|
||||
icon = 'icons/obj/mining.dmi'
|
||||
icon_state = "gigadrill"
|
||||
var/active = 0
|
||||
var/drill_time = 10
|
||||
var/turf/drilling_turf
|
||||
density = 1
|
||||
layer = 3.1 //to go over ores
|
||||
|
||||
/obj/machinery/giga_drill/attack_hand(mob/user as mob)
|
||||
if(active)
|
||||
active = 0
|
||||
icon_state = "gigadrill"
|
||||
user << "\blue You press a button and [src] slowly spins down."
|
||||
else
|
||||
active = 1
|
||||
icon_state = "gigadrill_mov"
|
||||
user << "\blue You press a button and [src] shudders to life."
|
||||
|
||||
/obj/machinery/giga_drill/Bump(atom/A)
|
||||
if(active && !drilling_turf)
|
||||
if(istype(A,/turf/simulated/mineral))
|
||||
var/turf/simulated/mineral/M = A
|
||||
drilling_turf = get_turf(src)
|
||||
src.visible_message("\red <b>[src] begins to drill into [M]!</b>")
|
||||
anchored = 1
|
||||
spawn(drill_time)
|
||||
if(get_turf(src) == drilling_turf && active)
|
||||
M.gets_drilled()
|
||||
src.loc = M
|
||||
drilling_turf = null
|
||||
anchored = 0
|
||||
52
code/modules/research/xenoarchaeology/artifact_hoverpod.dm
Normal file
52
code/modules/research/xenoarchaeology/artifact_hoverpod.dm
Normal file
@@ -0,0 +1,52 @@
|
||||
|
||||
/obj/mecha/working/hoverpod
|
||||
name = "hover pod"
|
||||
icon = 'icons/obj/vehicles.dmi'
|
||||
icon_state = "engineering_pod"
|
||||
desc = "Stubby and round, it has a human sized access hatch on the top."
|
||||
|
||||
//duplicate of parent proc, but without space drifting
|
||||
/obj/mecha/working/hoverpod/dyndomove(direction)
|
||||
if(!can_move)
|
||||
return 0
|
||||
if(src.pr_inertial_movement.active())
|
||||
return 0
|
||||
if(!has_charge(step_energy_drain))
|
||||
return 0
|
||||
var/move_result = 0
|
||||
if(hasInternalDamage(MECHA_INT_CONTROL_LOST))
|
||||
move_result = mechsteprand()
|
||||
else if(src.dir!=direction)
|
||||
move_result = mechturn(direction)
|
||||
else
|
||||
move_result = mechstep(direction)
|
||||
if(move_result)
|
||||
can_move = 0
|
||||
use_power(step_energy_drain)
|
||||
/*if(istype(src.loc, /turf/space))
|
||||
if(!src.check_for_support())
|
||||
src.pr_inertial_movement.start(list(src,direction))
|
||||
src.log_message("Movement control lost. Inertial movement started.")*/
|
||||
if(do_after(step_in))
|
||||
can_move = 1
|
||||
return 1
|
||||
return 0
|
||||
|
||||
//these three procs overriden to play different sounds
|
||||
/obj/mecha/mechturn(direction)
|
||||
dir = direction
|
||||
//playsound(src,'sound/machines/hiss.ogg',40,1)
|
||||
return 1
|
||||
|
||||
/obj/mecha/mechstep(direction)
|
||||
var/result = step(src,direction)
|
||||
if(result)
|
||||
playsound(src,'sound/machines/hiss.ogg',40,1)
|
||||
return result
|
||||
|
||||
|
||||
/obj/mecha/mechsteprand()
|
||||
var/result = step_rand(src)
|
||||
if(result)
|
||||
playsound(src,'sound/machines/hiss.ogg',40,1)
|
||||
return result
|
||||
120
code/modules/research/xenoarchaeology/artifact_replicator.dm
Normal file
120
code/modules/research/xenoarchaeology/artifact_replicator.dm
Normal file
@@ -0,0 +1,120 @@
|
||||
|
||||
/obj/machinery/replicator
|
||||
name = "alien machine"
|
||||
desc = "It's some kind of pod with strange wires and gadgets all over it."
|
||||
icon = 'xenoarchaeology.dmi'
|
||||
icon_state = "borgcharger0(old)"
|
||||
density = 1
|
||||
|
||||
idle_power_usage = 100
|
||||
active_power_usage = 1000
|
||||
use_power = 1
|
||||
|
||||
var/spawn_progress = 0
|
||||
var/max_spawn_ticks = 5
|
||||
var/list/construction = list()
|
||||
var/list/spawning_types = list()
|
||||
|
||||
/obj/machinery/replicator/New()
|
||||
..()
|
||||
|
||||
var/list/viables = list(\
|
||||
/obj/item/roller,\
|
||||
/obj/structure/cult/pylon,\
|
||||
/obj/structure/closet/crate,\
|
||||
/obj/structure/closet/acloset,\
|
||||
/mob/living/simple_animal/hostile/mimic,\
|
||||
/mob/living/simple_animal/hostile/viscerator,\
|
||||
/mob/living/simple_animal/hostile/hivebot,\
|
||||
/obj/item/device/analyzer,\
|
||||
/obj/item/device/camera,\
|
||||
/obj/item/device/flash,\
|
||||
/obj/item/device/flashlight,\
|
||||
/obj/item/device/healthanalyzer,\
|
||||
/obj/item/device/multitool,\
|
||||
/obj/item/device/paicard,\
|
||||
/obj/item/device/radio,\
|
||||
/obj/item/device/radio/headset,\
|
||||
/obj/item/device/radio/beacon,\
|
||||
/obj/item/weapon/autopsy_scanner,\
|
||||
/obj/item/weapon/bikehorn,\
|
||||
/obj/item/weapon/bonesetter,\
|
||||
/obj/item/weapon/butch,\
|
||||
/obj/item/weapon/caution,\
|
||||
/obj/item/weapon/caution/cone,\
|
||||
/obj/item/weapon/crowbar,\
|
||||
/obj/item/weapon/clipboard,\
|
||||
/obj/item/weapon/cell,\
|
||||
/obj/item/weapon/circular_saw,\
|
||||
/obj/item/weapon/hatchet,\
|
||||
/obj/item/weapon/handcuffs,\
|
||||
/obj/item/weapon/hemostat,\
|
||||
/obj/item/weapon/kitchenknife,\
|
||||
/obj/item/weapon/lighter,\
|
||||
/obj/item/weapon/lighter,\
|
||||
/obj/item/weapon/light/bulb,\
|
||||
/obj/item/weapon/light/tube,\
|
||||
/obj/item/weapon/pickaxe,\
|
||||
/obj/item/weapon/shovel,\
|
||||
/obj/item/weapon/table_parts,\
|
||||
/obj/item/weapon/weldingtool,\
|
||||
/obj/item/weapon/wirecutters,\
|
||||
/obj/item/weapon/wrench,\
|
||||
/obj/item/weapon/screwdriver,\
|
||||
/obj/item/weapon/grenade/chem_grenade/cleaner,\
|
||||
/obj/item/weapon/grenade/chem_grenade/metalfoam\
|
||||
)
|
||||
|
||||
var/quantity = rand(5,15)
|
||||
for(var/i=0, i<quantity, i++)
|
||||
var/button_desc = "[pick("a yellow","a purple","a green","a blue","a red","an orange","a white")], "
|
||||
button_desc += "[pick("round","square","diamond","heart","dog","human")] shaped "
|
||||
button_desc += "[pick("toggle","switch","lever","button","pad","hole")]"
|
||||
var/type = pick(viables)
|
||||
viables.Remove(type)
|
||||
construction[button_desc] = type
|
||||
|
||||
/obj/machinery/replicator/process()
|
||||
if(spawning_types.len && powered())
|
||||
spawn_progress++
|
||||
if(spawn_progress > max_spawn_ticks)
|
||||
src.visible_message("\blue \icon[src] [src] pings!")
|
||||
var/spawn_type = spawning_types[1]
|
||||
new spawn_type(src.loc)
|
||||
|
||||
spawning_types.Remove(spawning_types[1])
|
||||
spawn_progress = 0
|
||||
max_spawn_ticks = rand(5,30)
|
||||
|
||||
if(!spawning_types.len)
|
||||
use_power = 1
|
||||
icon_state = "borgcharger0(old)"
|
||||
|
||||
else if(prob(5))
|
||||
src.visible_message("\blue \icon[src] [src] [pick("clicks","whizzes","whirrs","whooshes","clanks","clongs","clonks","bangs")].")
|
||||
|
||||
/obj/machinery/replicator/attack_hand(mob/user as mob)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/replicator/interact(mob/user)
|
||||
var/dat = "The control panel displays an incomprehensible selection of controls, many with unusual markings or text around them.<br>"
|
||||
dat += "<br>"
|
||||
for(var/index=1, index<=construction.len, index++)
|
||||
dat += "<A href='?src=\ref[src];activate=[index]'>\[[construction[index]]\]</a><br>"
|
||||
|
||||
user << browse(dat, "window=alien_replicator")
|
||||
|
||||
/obj/machinery/replicator/Topic(href, href_list)
|
||||
|
||||
if(href_list["activate"])
|
||||
var/index = text2num(href_list["activate"])
|
||||
if(index > 0 && index <= construction.len)
|
||||
if(spawning_types.len)
|
||||
src.visible_message("\blue \icon[src] a [pick("light","dial","display","meter","pad")] on [src]'s front [pick("blinks","flashes")] [pick("red","yellow","blue","orange","purple","green","white")].")
|
||||
else
|
||||
src.visible_message("\blue \icon[src] [src]'s front compartment slides shut.")
|
||||
|
||||
spawning_types.Add(construction[construction[index]])
|
||||
spawn_progress = 0
|
||||
use_power = 2
|
||||
icon_state = "borgcharger1(old)"
|
||||
@@ -1,224 +1,9 @@
|
||||
//original code and idea from Alfie275 (luna era) and ISaidNo (goonservers) - with thanks
|
||||
|
||||
#define ARCHAEO_BOWL 1
|
||||
#define ARCHAEO_URN 2
|
||||
#define ARCHAEO_CUTLERY 3
|
||||
#define ARCHAEO_STATUETTE 4
|
||||
#define ARCHAEO_INSTRUMENT 5
|
||||
#define ARCHAEO_KNIFE 6
|
||||
#define ARCHAEO_COIN 7
|
||||
#define ARCHAEO_HANDCUFFS 8
|
||||
#define ARCHAEO_BEARTRAP 9
|
||||
#define ARCHAEO_LIGHTER 10
|
||||
#define ARCHAEO_BOX 11
|
||||
#define ARCHAEO_GASTANK 12
|
||||
#define ARCHAEO_TOOL 13
|
||||
#define ARCHAEO_METAL 14
|
||||
#define ARCHAEO_PEN 15
|
||||
#define ARCHAEO_CRYSTAL 16
|
||||
#define ARCHAEO_CULTBLADE 17
|
||||
#define ARCHAEO_TELEBEACON 18
|
||||
#define ARCHAEO_CLAYMORE 19
|
||||
#define ARCHAEO_CULTROBES 20
|
||||
#define ARCHAEO_SOULSTONE 21
|
||||
#define ARCHAEO_SHARD 22
|
||||
#define ARCHAEO_RODS 23
|
||||
#define ARCHAEO_STOCKPARTS 24
|
||||
#define ARCHAEO_KATANA 25
|
||||
#define ARCHAEO_LASER 26
|
||||
#define ARCHAEO_GUN 27
|
||||
#define ARCHAEO_UNKNOWN 28
|
||||
#define ARCHAEO_FOSSIL 29
|
||||
#define ARCHAEO_SHELL 30
|
||||
#define ARCHAEO_PLANT 31
|
||||
#define ARCHAEO_REMAINS_HUMANOID 32
|
||||
#define ARCHAEO_REMAINS_ROBOT 33
|
||||
#define ARCHAEO_REMAINS_XENO 34
|
||||
//eggs
|
||||
//droppings
|
||||
//footprints
|
||||
//alien clothing
|
||||
|
||||
//DNA sampling from fossils, or a new archaeo type specifically for it?
|
||||
|
||||
//descending order of likeliness to spawn
|
||||
#define DIGSITE_GARDEN 1
|
||||
#define DIGSITE_ANIMAL 2
|
||||
#define DIGSITE_HOUSE 3
|
||||
#define DIGSITE_TECHNICAL 4
|
||||
#define DIGSITE_TEMPLE 5
|
||||
#define DIGSITE_WAR 6
|
||||
|
||||
/proc/get_responsive_reagent(var/find_type)
|
||||
switch(find_type)
|
||||
if(ARCHAEO_BOWL)
|
||||
return "aluminium"
|
||||
if(ARCHAEO_URN)
|
||||
return "aluminium"
|
||||
if(ARCHAEO_CUTLERY)
|
||||
return "aluminium"
|
||||
if(ARCHAEO_STATUETTE)
|
||||
return "aluminium"
|
||||
if(ARCHAEO_INSTRUMENT)
|
||||
return "aluminium"
|
||||
if(ARCHAEO_COIN)
|
||||
return "silicon"
|
||||
if(ARCHAEO_HANDCUFFS)
|
||||
return "aluminium"
|
||||
if(ARCHAEO_BEARTRAP)
|
||||
return "aluminium"
|
||||
if(ARCHAEO_LIGHTER)
|
||||
return "aluminium"
|
||||
if(ARCHAEO_BOX)
|
||||
return "aluminium"
|
||||
if(ARCHAEO_GASTANK)
|
||||
return "aluminium"
|
||||
if(ARCHAEO_TOOL)
|
||||
return "silicon"
|
||||
if(ARCHAEO_METAL)
|
||||
return "silicon"
|
||||
if(ARCHAEO_PEN)
|
||||
return "aluminium"
|
||||
if(ARCHAEO_CRYSTAL)
|
||||
return "helium"
|
||||
if(ARCHAEO_CULTBLADE)
|
||||
return "neon"
|
||||
if(ARCHAEO_TELEBEACON)
|
||||
return "neon"
|
||||
if(ARCHAEO_CLAYMORE)
|
||||
return "silicon"
|
||||
if(ARCHAEO_CULTROBES)
|
||||
return "neon"
|
||||
if(ARCHAEO_SOULSTONE)
|
||||
return "helium"
|
||||
if(ARCHAEO_SHARD)
|
||||
return "helium"
|
||||
if(ARCHAEO_RODS)
|
||||
return "silicon"
|
||||
if(ARCHAEO_STOCKPARTS)
|
||||
return "neon"
|
||||
if(ARCHAEO_KATANA)
|
||||
return "silicon"
|
||||
if(ARCHAEO_LASER)
|
||||
return "silicon"
|
||||
if(ARCHAEO_GUN)
|
||||
return "silicon"
|
||||
if(ARCHAEO_UNKNOWN)
|
||||
return "beryllium"
|
||||
if(ARCHAEO_FOSSIL)
|
||||
return "carbon"
|
||||
if(ARCHAEO_PLANT)
|
||||
return "carbon"
|
||||
if(ARCHAEO_REMAINS_HUMANOID)
|
||||
return "carbon"
|
||||
if(ARCHAEO_REMAINS_ROBOT)
|
||||
return "carbon"
|
||||
if(ARCHAEO_REMAINS_XENO)
|
||||
return "carbon"
|
||||
return "chlorine"
|
||||
|
||||
//see /turf/simulated/mineral/New() in code/modules/mining/mine_turfs.dm
|
||||
/proc/get_random_digsite_type()
|
||||
return pick(100;DIGSITE_GARDEN,95;DIGSITE_ANIMAL,90;DIGSITE_HOUSE,85;DIGSITE_TECHNICAL,80;DIGSITE_TEMPLE,75;DIGSITE_WAR)
|
||||
|
||||
/proc/get_random_find_type(var/digsite)
|
||||
|
||||
var/find_type = 0
|
||||
switch(digsite)
|
||||
if(DIGSITE_GARDEN)
|
||||
find_type = pick(\
|
||||
100;ARCHAEO_PLANT,\
|
||||
25;ARCHAEO_SHELL,\
|
||||
25;ARCHAEO_FOSSIL,\
|
||||
10;ARCHAEO_REMAINS_XENO,\
|
||||
5;ARCHAEO_BEARTRAP\
|
||||
)
|
||||
if(DIGSITE_ANIMAL)
|
||||
find_type = pick(\
|
||||
100;ARCHAEO_FOSSIL,\
|
||||
50;ARCHAEO_SHELL,\
|
||||
50;ARCHAEO_PLANT,\
|
||||
50;ARCHAEO_REMAINS_XENO,\
|
||||
25;ARCHAEO_BEARTRAP\
|
||||
)
|
||||
if(DIGSITE_HOUSE)
|
||||
find_type = pick(\
|
||||
100;ARCHAEO_BOWL,\
|
||||
100;ARCHAEO_URN,\
|
||||
100;ARCHAEO_CUTLERY,\
|
||||
100;ARCHAEO_STATUETTE,\
|
||||
100;ARCHAEO_INSTRUMENT,\
|
||||
100;ARCHAEO_PEN,\
|
||||
100;ARCHAEO_LIGHTER,\
|
||||
100;ARCHAEO_BOX,\
|
||||
75;ARCHAEO_COIN,\
|
||||
75;ARCHAEO_UNKNOWN,\
|
||||
75;ARCHAEO_REMAINS_HUMANOID,\
|
||||
75;ARCHAEO_REMAINS_ROBOT,\
|
||||
75;ARCHAEO_REMAINS_XENO,\
|
||||
50;ARCHAEO_SHARD,\
|
||||
50;ARCHAEO_RODS,\
|
||||
25;ARCHAEO_METAL\
|
||||
)
|
||||
if(DIGSITE_TECHNICAL)
|
||||
find_type = pick(\
|
||||
100;ARCHAEO_METAL,\
|
||||
100;ARCHAEO_GASTANK,\
|
||||
100;ARCHAEO_TELEBEACON,\
|
||||
100;ARCHAEO_TOOL,\
|
||||
100;ARCHAEO_STOCKPARTS,\
|
||||
100;ARCHAEO_REMAINS_ROBOT,\
|
||||
75;ARCHAEO_SHARD,\
|
||||
75;ARCHAEO_RODS,\
|
||||
75;ARCHAEO_UNKNOWN,\
|
||||
50;ARCHAEO_HANDCUFFS,\
|
||||
50;ARCHAEO_BEARTRAP,\
|
||||
25;ARCHAEO_REMAINS_HUMANOID,\
|
||||
25;ARCHAEO_REMAINS_XENO\
|
||||
)
|
||||
if(DIGSITE_TEMPLE)
|
||||
find_type = pick(\
|
||||
200;ARCHAEO_CULTROBES,\
|
||||
100;ARCHAEO_URN,\
|
||||
100;ARCHAEO_BOWL,\
|
||||
100;ARCHAEO_KNIFE,\
|
||||
100;ARCHAEO_CRYSTAL,\
|
||||
75;ARCHAEO_CULTBLADE,\
|
||||
75;ARCHAEO_REMAINS_HUMANOID,\
|
||||
75;ARCHAEO_REMAINS_XENO,\
|
||||
50;ARCHAEO_SOULSTONE,\
|
||||
50;ARCHAEO_UNKNOWN,\
|
||||
25;ARCHAEO_HANDCUFFS,\
|
||||
25;ARCHAEO_BEARTRAP,\
|
||||
10;ARCHAEO_KATANA,\
|
||||
10;ARCHAEO_CLAYMORE,\
|
||||
10;ARCHAEO_SHARD,\
|
||||
10;ARCHAEO_RODS,\
|
||||
10;ARCHAEO_METAL\
|
||||
)
|
||||
if(DIGSITE_WAR)
|
||||
find_type = pick(\
|
||||
100;ARCHAEO_GUN,\
|
||||
100;ARCHAEO_KNIFE,\
|
||||
75;ARCHAEO_LASER,\
|
||||
75;ARCHAEO_KATANA,\
|
||||
75;ARCHAEO_CLAYMORE,\
|
||||
75;ARCHAEO_REMAINS_HUMANOID,\
|
||||
75;ARCHAEO_REMAINS_XENO,\
|
||||
50;ARCHAEO_UNKNOWN,\
|
||||
50;ARCHAEO_CULTROBES,\
|
||||
50;ARCHAEO_CULTBLADE,\
|
||||
50;ARCHAEO_REMAINS_ROBOT,\
|
||||
25;ARCHAEO_HANDCUFFS,\
|
||||
25;ARCHAEO_BEARTRAP,\
|
||||
25;ARCHAEO_TOOL\
|
||||
)
|
||||
return find_type
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Xenoarchaeological finds
|
||||
|
||||
datum/find
|
||||
/datum/find
|
||||
var/find_type = 0 //random according to the digsite type
|
||||
var/excavation_required = 0 //random 5-95%
|
||||
var/view_range = 20 //how close excavation has to come to show an overlay on the turf
|
||||
@@ -228,30 +13,12 @@ datum/find
|
||||
var/dissonance_spread = 1 //proportion of the tile that is affected by this find
|
||||
//used in conjunction with analysis machines to determine correct suspension field type
|
||||
|
||||
datum/find/New(var/digsite, var/exc_req)
|
||||
/datum/find/New(var/digsite, var/exc_req)
|
||||
excavation_required = exc_req
|
||||
find_type = get_random_find_type(digsite)
|
||||
clearance_range = rand(2,6)
|
||||
dissonance_spread = rand(1500,2500) / 100
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Rock sliver
|
||||
|
||||
/obj/item/weapon/rocksliver
|
||||
name = "rock sliver"
|
||||
desc = "It looks extremely delicate."
|
||||
icon = 'xenoarchaeology.dmi'
|
||||
icon_state = "sliver1" //0-4
|
||||
w_class = 1
|
||||
//item_state = "electronic"
|
||||
var/source_rock = "/turf/simulated/mineral/"
|
||||
var/datum/geosample/geological_data
|
||||
|
||||
/obj/item/weapon/rocksliver/New()
|
||||
icon_state = "sliver[rand(1,3)]"
|
||||
pixel_x = rand(0,16)-8
|
||||
pixel_y = rand(0,8)-8
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Strange rocks
|
||||
|
||||
@@ -266,6 +33,7 @@ datum/find/New(var/digsite, var/exc_req)
|
||||
|
||||
/obj/item/weapon/ore/strangerock/New(loc, var/inside_item_type = 0)
|
||||
..(loc)
|
||||
|
||||
method = rand(0,2)
|
||||
if(inside_item_type)
|
||||
inside = new/obj/item/weapon/archaeological_find(src, new_item_type = inside_item_type)
|
||||
@@ -306,6 +74,9 @@ datum/find/New(var/digsite, var/exc_req)
|
||||
src.visible_message("<span class='warning'>[src] crumbles away, leaving some dust and gravel behind.</span>")
|
||||
del(src)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Archaeological finds
|
||||
|
||||
/obj/item/weapon/archaeological_find
|
||||
name = "object"
|
||||
icon = 'xenoarchaeology.dmi'
|
||||
@@ -468,12 +239,15 @@ datum/find/New(var/digsite, var/exc_req)
|
||||
if(prob(30))
|
||||
apply_image_decorations = 1
|
||||
if(16)
|
||||
if(prob(50))
|
||||
if(prob(33))
|
||||
item_type = "smooth green crystal"
|
||||
icon_state = "Green lump"
|
||||
else
|
||||
else if(prob(50))
|
||||
item_type = "irregular purple crystal"
|
||||
icon_state = "Phazon"
|
||||
else
|
||||
item_type = "smooth red crystal"
|
||||
icon_state = "ore"
|
||||
additional_desc = pick("It shines faintly as it catches the light.","It appears to have a faint inner glow.","It seems to draw you inward as you look it at.","Something twinkles faintly as you look at it.","It's mesmerizing to behold.")
|
||||
|
||||
apply_material_decorations = 0
|
||||
@@ -507,7 +281,9 @@ datum/find/New(var/digsite, var/exc_req)
|
||||
new_item = new /obj/item/device/soulstone(src.loc)
|
||||
apply_material_decorations = 0
|
||||
if(22)
|
||||
new_item = new /obj/item/weapon/shard(src.loc)
|
||||
if(prob(50))
|
||||
new_item = new /obj/item/weapon/shard(src.loc)
|
||||
new_item = new /obj/item/weapon/shard/plasma(src.loc)
|
||||
apply_image_decorations = 0
|
||||
apply_material_decorations = 0
|
||||
if(23)
|
||||
@@ -723,30 +499,3 @@ datum/find/New(var/digsite, var/exc_req)
|
||||
if(prob(25))
|
||||
speaking_to_players = 1
|
||||
processing_objects.Add(src)
|
||||
|
||||
//legacy crystal
|
||||
/obj/item/weapon/crystal
|
||||
name = "Crystal"
|
||||
icon = 'mining.dmi'
|
||||
icon_state = "crystal"
|
||||
|
||||
//large finds
|
||||
/*
|
||||
/obj/machinery/syndicate_beacon
|
||||
/obj/machinery/wish_granter
|
||||
if(18)
|
||||
item_type = "jagged green crystal"
|
||||
additional_desc = pick("It shines faintly as it catches the light.","It appears to have a faint inner glow.","It seems to draw you inward as you look it at.","Something twinkles faintly as you look at it.","It's mesmerizing to behold.")
|
||||
icon_state = "crystal"
|
||||
apply_material_decorations = 0
|
||||
if(prob(10))
|
||||
apply_image_decorations = 1
|
||||
if(19)
|
||||
item_type = "jagged pink crystal"
|
||||
additional_desc = pick("It shines faintly as it catches the light.","It appears to have a faint inner glow.","It seems to draw you inward as you look it at.","Something twinkles faintly as you look at it.","It's mesmerizing to behold.")
|
||||
icon_state = "crystal2"
|
||||
apply_material_decorations = 0
|
||||
if(prob(10))
|
||||
apply_image_decorations = 1
|
||||
*/
|
||||
//machinery type artifacts?
|
||||
258
code/modules/research/xenoarchaeology/finds_defines.dm
Normal file
258
code/modules/research/xenoarchaeology/finds_defines.dm
Normal file
@@ -0,0 +1,258 @@
|
||||
|
||||
#define ARCHAEO_BOWL 1
|
||||
#define ARCHAEO_URN 2
|
||||
#define ARCHAEO_CUTLERY 3
|
||||
#define ARCHAEO_STATUETTE 4
|
||||
#define ARCHAEO_INSTRUMENT 5
|
||||
#define ARCHAEO_KNIFE 6
|
||||
#define ARCHAEO_COIN 7
|
||||
#define ARCHAEO_HANDCUFFS 8
|
||||
#define ARCHAEO_BEARTRAP 9
|
||||
#define ARCHAEO_LIGHTER 10
|
||||
#define ARCHAEO_BOX 11
|
||||
#define ARCHAEO_GASTANK 12
|
||||
#define ARCHAEO_TOOL 13
|
||||
#define ARCHAEO_METAL 14
|
||||
#define ARCHAEO_PEN 15
|
||||
#define ARCHAEO_CRYSTAL 16
|
||||
#define ARCHAEO_CULTBLADE 17
|
||||
#define ARCHAEO_TELEBEACON 18
|
||||
#define ARCHAEO_CLAYMORE 19
|
||||
#define ARCHAEO_CULTROBES 20
|
||||
#define ARCHAEO_SOULSTONE 21
|
||||
#define ARCHAEO_SHARD 22
|
||||
#define ARCHAEO_RODS 23
|
||||
#define ARCHAEO_STOCKPARTS 24
|
||||
#define ARCHAEO_KATANA 25
|
||||
#define ARCHAEO_LASER 26
|
||||
#define ARCHAEO_GUN 27
|
||||
#define ARCHAEO_UNKNOWN 28
|
||||
#define ARCHAEO_FOSSIL 29
|
||||
#define ARCHAEO_SHELL 30
|
||||
#define ARCHAEO_PLANT 31
|
||||
//eggs
|
||||
//droppings
|
||||
//footprints
|
||||
//alien clothing
|
||||
|
||||
//DNA sampling from fossils, or a new archaeo type specifically for it?
|
||||
|
||||
#define ARTIFACT_REMAINS_HUMANOID 1
|
||||
#define ARTIFACT_REMAINS_ROBOT 2
|
||||
#define ARTIFACT_REMAINS_XENO 3
|
||||
#define ARTIFACT_MACHINERY 4
|
||||
#define ARTIFACT_OCCULT 5
|
||||
#define ARTIFACT_SYNDBEACON 6
|
||||
|
||||
//?
|
||||
#define ARTIFACT_HEAL 4
|
||||
#define ARTIFACT_BIODAM 5
|
||||
#define ARTIFACT_POWERCHARGE 6
|
||||
#define ARTIFACT_POWERDRAIN 7
|
||||
#define ARTIFACT_EMP 8
|
||||
#define ARTIFACT_PLANTGROW 9
|
||||
#define ARTIFACT_WEAKEN 10
|
||||
#define ARTIFACT_SLEEPY 11
|
||||
#define ARTIFACT_TELEPORT 12
|
||||
#define ARTIFACT_ROBOHURT 13
|
||||
#define ARTIFACT_ROBOHEAL 14
|
||||
#define ARTIFACT_DNASWITCH 15
|
||||
#define ARTIFACT_
|
||||
#define ARTIFACT_
|
||||
|
||||
//descending order of likeliness to spawn
|
||||
#define DIGSITE_GARDEN 1
|
||||
#define DIGSITE_ANIMAL 2
|
||||
#define DIGSITE_HOUSE 3
|
||||
#define DIGSITE_TECHNICAL 4
|
||||
#define DIGSITE_TEMPLE 5
|
||||
#define DIGSITE_WAR 6
|
||||
|
||||
/proc/get_responsive_reagent(var/find_type)
|
||||
switch(find_type)
|
||||
if(ARCHAEO_BOWL)
|
||||
return "aluminium"
|
||||
if(ARCHAEO_URN)
|
||||
return "aluminium"
|
||||
if(ARCHAEO_CUTLERY)
|
||||
return "aluminium"
|
||||
if(ARCHAEO_STATUETTE)
|
||||
return "aluminium"
|
||||
if(ARCHAEO_INSTRUMENT)
|
||||
return "aluminium"
|
||||
if(ARCHAEO_COIN)
|
||||
return "silicon"
|
||||
if(ARCHAEO_HANDCUFFS)
|
||||
return "aluminium"
|
||||
if(ARCHAEO_BEARTRAP)
|
||||
return "aluminium"
|
||||
if(ARCHAEO_LIGHTER)
|
||||
return "aluminium"
|
||||
if(ARCHAEO_BOX)
|
||||
return "aluminium"
|
||||
if(ARCHAEO_GASTANK)
|
||||
return "aluminium"
|
||||
if(ARCHAEO_TOOL)
|
||||
return "silicon"
|
||||
if(ARCHAEO_METAL)
|
||||
return "silicon"
|
||||
if(ARCHAEO_PEN)
|
||||
return "aluminium"
|
||||
if(ARCHAEO_CRYSTAL)
|
||||
return "helium"
|
||||
if(ARCHAEO_CULTBLADE)
|
||||
return "neon"
|
||||
if(ARCHAEO_TELEBEACON)
|
||||
return "neon"
|
||||
if(ARCHAEO_CLAYMORE)
|
||||
return "silicon"
|
||||
if(ARCHAEO_CULTROBES)
|
||||
return "neon"
|
||||
if(ARCHAEO_SOULSTONE)
|
||||
return "helium"
|
||||
if(ARCHAEO_SHARD)
|
||||
return "helium"
|
||||
if(ARCHAEO_RODS)
|
||||
return "silicon"
|
||||
if(ARCHAEO_STOCKPARTS)
|
||||
return "neon"
|
||||
if(ARCHAEO_KATANA)
|
||||
return "silicon"
|
||||
if(ARCHAEO_LASER)
|
||||
return "silicon"
|
||||
if(ARCHAEO_GUN)
|
||||
return "silicon"
|
||||
if(ARCHAEO_UNKNOWN)
|
||||
return "beryllium"
|
||||
if(ARCHAEO_FOSSIL)
|
||||
return "carbon"
|
||||
if(ARCHAEO_PLANT)
|
||||
return "carbon"
|
||||
return "chlorine"
|
||||
|
||||
//see /turf/simulated/mineral/New() in code/modules/mining/mine_turfs.dm
|
||||
/proc/get_random_digsite_type()
|
||||
return pick(100;DIGSITE_GARDEN,95;DIGSITE_ANIMAL,90;DIGSITE_HOUSE,85;DIGSITE_TECHNICAL,80;DIGSITE_TEMPLE,75;DIGSITE_WAR)
|
||||
|
||||
/proc/get_random_find_type(var/digsite)
|
||||
|
||||
var/find_type = 0
|
||||
switch(digsite)
|
||||
if(DIGSITE_GARDEN)
|
||||
find_type = pick(\
|
||||
100;ARCHAEO_PLANT,\
|
||||
25;ARCHAEO_SHELL,\
|
||||
25;ARCHAEO_FOSSIL,\
|
||||
5;ARCHAEO_BEARTRAP\
|
||||
)
|
||||
if(DIGSITE_ANIMAL)
|
||||
find_type = pick(\
|
||||
100;ARCHAEO_FOSSIL,\
|
||||
50;ARCHAEO_SHELL,\
|
||||
50;ARCHAEO_PLANT,\
|
||||
25;ARCHAEO_BEARTRAP\
|
||||
)
|
||||
if(DIGSITE_HOUSE)
|
||||
find_type = pick(\
|
||||
100;ARCHAEO_BOWL,\
|
||||
100;ARCHAEO_URN,\
|
||||
100;ARCHAEO_CUTLERY,\
|
||||
100;ARCHAEO_STATUETTE,\
|
||||
100;ARCHAEO_INSTRUMENT,\
|
||||
100;ARCHAEO_PEN,\
|
||||
100;ARCHAEO_LIGHTER,\
|
||||
100;ARCHAEO_BOX,\
|
||||
75;ARCHAEO_COIN,\
|
||||
75;ARCHAEO_UNKNOWN,\
|
||||
50;ARCHAEO_SHARD,\
|
||||
50;ARCHAEO_RODS,\
|
||||
25;ARCHAEO_METAL\
|
||||
)
|
||||
if(DIGSITE_TECHNICAL)
|
||||
find_type = pick(\
|
||||
100;ARCHAEO_METAL,\
|
||||
100;ARCHAEO_GASTANK,\
|
||||
100;ARCHAEO_TELEBEACON,\
|
||||
100;ARCHAEO_TOOL,\
|
||||
100;ARCHAEO_STOCKPARTS,\
|
||||
75;ARCHAEO_SHARD,\
|
||||
75;ARCHAEO_RODS,\
|
||||
75;ARCHAEO_UNKNOWN,\
|
||||
50;ARCHAEO_HANDCUFFS,\
|
||||
50;ARCHAEO_BEARTRAP,\
|
||||
)
|
||||
if(DIGSITE_TEMPLE)
|
||||
find_type = pick(\
|
||||
200;ARCHAEO_CULTROBES,\
|
||||
100;ARCHAEO_URN,\
|
||||
100;ARCHAEO_BOWL,\
|
||||
100;ARCHAEO_KNIFE,\
|
||||
100;ARCHAEO_CRYSTAL,\
|
||||
75;ARCHAEO_CULTBLADE,\
|
||||
50;ARCHAEO_SOULSTONE,\
|
||||
50;ARCHAEO_UNKNOWN,\
|
||||
25;ARCHAEO_HANDCUFFS,\
|
||||
25;ARCHAEO_BEARTRAP,\
|
||||
10;ARCHAEO_KATANA,\
|
||||
10;ARCHAEO_CLAYMORE,\
|
||||
10;ARCHAEO_SHARD,\
|
||||
10;ARCHAEO_RODS,\
|
||||
10;ARCHAEO_METAL\
|
||||
)
|
||||
if(DIGSITE_WAR)
|
||||
find_type = pick(\
|
||||
100;ARCHAEO_GUN,\
|
||||
100;ARCHAEO_KNIFE,\
|
||||
75;ARCHAEO_LASER,\
|
||||
75;ARCHAEO_KATANA,\
|
||||
75;ARCHAEO_CLAYMORE,\
|
||||
50;ARCHAEO_UNKNOWN,\
|
||||
50;ARCHAEO_CULTROBES,\
|
||||
50;ARCHAEO_CULTBLADE,\
|
||||
25;ARCHAEO_HANDCUFFS,\
|
||||
25;ARCHAEO_BEARTRAP,\
|
||||
25;ARCHAEO_TOOL\
|
||||
)
|
||||
return find_type
|
||||
|
||||
#undef ARCHAEO_BOWL
|
||||
#undef ARCHAEO_URN
|
||||
#undef ARCHAEO_CUTLERY
|
||||
#undef ARCHAEO_STATUETTE
|
||||
#undef ARCHAEO_INSTRUMENT
|
||||
#undef ARCHAEO_KNIFE
|
||||
#undef ARCHAEO_COIN
|
||||
#undef ARCHAEO_HANDCUFFS
|
||||
#undef ARCHAEO_BEARTRAP
|
||||
#undef ARCHAEO_LIGHTER
|
||||
#undef ARCHAEO_BOX
|
||||
#undef ARCHAEO_GASTANK
|
||||
#undef ARCHAEO_TOOL
|
||||
#undef ARCHAEO_METAL
|
||||
#undef ARCHAEO_PEN
|
||||
#undef ARCHAEO_CRYSTAL
|
||||
#undef ARCHAEO_CULTBLADE
|
||||
#undef ARCHAEO_TELEBEACON
|
||||
#undef ARCHAEO_CLAYMORE
|
||||
#undef ARCHAEO_CULTROBES
|
||||
#undef ARCHAEO_SOULSTONE
|
||||
#undef ARCHAEO_SHARD
|
||||
#undef ARCHAEO_RODS
|
||||
#undef ARCHAEO_STOCKPARTS
|
||||
#undef ARCHAEO_KATANA
|
||||
#undef ARCHAEO_LASER
|
||||
#undef ARCHAEO_GUN
|
||||
#undef ARCHAEO_UNKNOWN
|
||||
#undef ARCHAEO_FOSSIL
|
||||
#undef ARCHAEO_SHELL
|
||||
#undef ARCHAEO_PLANT
|
||||
#undef ARCHAEO_REMAINS_HUMANOID
|
||||
#undef ARCHAEO_REMAINS_ROBOT
|
||||
#undef ARCHAEO_REMAINS_XENO
|
||||
|
||||
#undef DIGSITE_GARDEN
|
||||
#undef DIGSITE_ANIMAL
|
||||
#undef DIGSITE_HOUSE
|
||||
#undef DIGSITE_TECHNICAL
|
||||
#undef DIGSITE_TEMPLE
|
||||
#undef DIGSITE_WAR
|
||||
69
code/modules/research/xenoarchaeology/finds_misc.dm
Normal file
69
code/modules/research/xenoarchaeology/finds_misc.dm
Normal file
@@ -0,0 +1,69 @@
|
||||
|
||||
/obj/item/weapon/shard/plasma
|
||||
name = "plasma shard"
|
||||
icon_state = "plasmalarge"
|
||||
|
||||
/obj/item/weapon/shard/plasma/New()
|
||||
|
||||
src.icon_state = pick("plasmalarge", "plasmamedium", "plasmasmall")
|
||||
switch(src.icon_state)
|
||||
if("plasmasmall")
|
||||
src.pixel_x = rand(-12, 12)
|
||||
src.pixel_y = rand(-12, 12)
|
||||
if("plasmamedium")
|
||||
src.pixel_x = rand(-8, 8)
|
||||
src.pixel_y = rand(-8, 8)
|
||||
if("plasmalarge")
|
||||
src.pixel_x = rand(-5, 5)
|
||||
src.pixel_y = rand(-5, 5)
|
||||
else
|
||||
return
|
||||
|
||||
/obj/item/weapon/shard/plasma/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if ( istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
if(WT.remove_fuel(0, user))
|
||||
var/obj/item/stack/sheet/mineral/plasma/NG = new (user.loc)
|
||||
for (var/obj/item/stack/sheet/mineral/plasma/G in user.loc)
|
||||
if(G==NG)
|
||||
continue
|
||||
if(G.amount>=G.max_amount)
|
||||
continue
|
||||
G.attackby(NG, user)
|
||||
usr << "You add the newly-formed plasma to the stack. It now contains [NG.amount] sheets."
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
return ..()
|
||||
|
||||
//legacy crystal
|
||||
/obj/machinery/crystal
|
||||
name = "Crystal"
|
||||
icon = 'mining.dmi'
|
||||
icon_state = "crystal"
|
||||
|
||||
/obj/machinery/crystal/New()
|
||||
if(prob(50))
|
||||
icon_state = "crystal2"
|
||||
|
||||
//large finds
|
||||
/*
|
||||
/obj/machinery/syndicate_beacon
|
||||
/obj/machinery/wish_granter
|
||||
if(18)
|
||||
item_type = "jagged green crystal"
|
||||
additional_desc = pick("It shines faintly as it catches the light.","It appears to have a faint inner glow.","It seems to draw you inward as you look it at.","Something twinkles faintly as you look at it.","It's mesmerizing to behold.")
|
||||
icon_state = "crystal"
|
||||
apply_material_decorations = 0
|
||||
if(prob(10))
|
||||
apply_image_decorations = 1
|
||||
if(19)
|
||||
item_type = "jagged pink crystal"
|
||||
additional_desc = pick("It shines faintly as it catches the light.","It appears to have a faint inner glow.","It seems to draw you inward as you look it at.","Something twinkles faintly as you look at it.","It's mesmerizing to behold.")
|
||||
icon_state = "crystal2"
|
||||
apply_material_decorations = 0
|
||||
if(prob(10))
|
||||
apply_image_decorations = 1
|
||||
*/
|
||||
//machinery type artifacts?
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
/*
|
||||
#define FIND_PLANT 1
|
||||
#define FIND_BIO 2
|
||||
#define FIND_METEORIC 3
|
||||
@@ -9,6 +9,25 @@
|
||||
#define FIND_METAMORPHIC 8
|
||||
#define FIND_SEDIMENTARY 9
|
||||
#define FIND_NOTHING 10
|
||||
*/
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Rock sliver
|
||||
|
||||
/obj/item/weapon/rocksliver
|
||||
name = "rock sliver"
|
||||
desc = "It looks extremely delicate."
|
||||
icon = 'xenoarchaeology.dmi'
|
||||
icon_state = "sliver1" //0-4
|
||||
w_class = 1
|
||||
//item_state = "electronic"
|
||||
var/source_rock = "/turf/simulated/mineral/"
|
||||
var/datum/geosample/geological_data
|
||||
|
||||
/obj/item/weapon/rocksliver/New()
|
||||
icon_state = "sliver[rand(1,3)]"
|
||||
pixel_x = rand(0,16)-8
|
||||
pixel_y = rand(0,8)-8
|
||||
|
||||
var/list/responsive_carriers = list( \
|
||||
"carbon", \
|
||||
@@ -34,7 +53,12 @@ var/list/finds_as_strings = list( \
|
||||
"Sedimentary/generic rock", \
|
||||
"Anomalous material" )
|
||||
|
||||
datum/geosample
|
||||
var/list/artifact_spawning_turfs = list()
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Geosample datum
|
||||
|
||||
/datum/geosample
|
||||
var/age = 0 //age can correspond to different archaeological finds
|
||||
var/age_thousand = 0
|
||||
var/age_million = 0
|
||||
@@ -48,12 +72,15 @@ datum/geosample
|
||||
//all potential finds are initialised to null, so nullcheck before you access them
|
||||
var/list/find_presence = list()
|
||||
|
||||
datum/geosample/New(var/turf/simulated/mineral/container)
|
||||
/datum/geosample/New(var/turf/simulated/mineral/container)
|
||||
|
||||
UpdateTurf(container)
|
||||
|
||||
//this should only need to be called once
|
||||
datum/geosample/proc/UpdateTurf(var/turf/simulated/mineral/container)
|
||||
/datum/geosample/proc/UpdateTurf(var/turf/simulated/mineral/container)
|
||||
if(!container || !istype(container))
|
||||
return
|
||||
|
||||
//source_mineral = container.mineralName
|
||||
age = rand(1,999)
|
||||
|
||||
@@ -128,3 +155,25 @@ datum/geosample/proc/UpdateTurf(var/turf/simulated/mineral/container)
|
||||
for(var/entry in find_presence)
|
||||
total_spread += find_presence[entry]
|
||||
|
||||
//have this separate from UpdateTurf() so that we dont have a billion turfs being updated (redundantly) every time an artifact spawns
|
||||
/datum/geosample/proc/UpdateNearbyArtifactInfo(var/turf/simulated/mineral/container)
|
||||
if(!container || !istype(container))
|
||||
return
|
||||
|
||||
for(var/turf/simulated/mineral/holder in artifact_spawning_turfs)
|
||||
var/dist = get_dist(container, holder)
|
||||
if(dist < artifact_distance)
|
||||
artifact_distance = dist
|
||||
//artifact_id = A.display_id
|
||||
/*
|
||||
#undef FIND_PLANT
|
||||
#undef FIND_BIO
|
||||
#undef FIND_METEORIC
|
||||
#undef FIND_ICE
|
||||
#undef FIND_CRYSTALLINE
|
||||
#undef FIND_METALLIC
|
||||
#undef FIND_IGNEOUS
|
||||
#undef FIND_METAMORPHIC
|
||||
#undef FIND_SEDIMENTARY
|
||||
#undef FIND_NOTHING
|
||||
*/
|
||||
@@ -1,67 +1,54 @@
|
||||
|
||||
/obj/item/clothing/suit/bio_suit/anomaly
|
||||
name = "Anomaly Suit"
|
||||
desc = "A sealed bio suit capable of resisting exotic alien energies and low pressure environments."
|
||||
icon_state = "engspace_suit"
|
||||
item_state = "engspace_suit"
|
||||
allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank/emergency_oxygen)
|
||||
|
||||
/obj/item/clothing/head/bio_hood/anomaly
|
||||
name = "Anomaly Hood"
|
||||
desc = "A sealed bio hood capable of resisting exotic alien energies and low pressure environments."
|
||||
icon_state = "engspace_helmet"
|
||||
item_state = "engspace_helmet"
|
||||
|
||||
/obj/structure/noticeboard/anomaly/New()
|
||||
notices = 5
|
||||
icon_state = "nboard05"
|
||||
|
||||
//add some memos
|
||||
var/obj/item/weapon/paper/P = new()
|
||||
P.name = "Memo RE: proper analysis procedure"
|
||||
P.info = "Rose,<br>activate <i>then</i> analyse the anomalies, your results will come so much quicker. Remember to employ basic quasi-elemental forces such as heat, energy, force and various chemical mixes - who knows why those ancient aliens made such obscure activation indices.<br><br>And don't forget your suit this time, I can't afford to have any researchers out of commision for as long as that again!.<br>Ward"
|
||||
P.stamped = list(/obj/item/weapon/stamp/rd)
|
||||
P.overlays = list("paper_stamped_rd")
|
||||
src.contents += P
|
||||
|
||||
P = new()
|
||||
P.name = "Memo RE: materials gathering"
|
||||
P.info = "Corasang,<br>the hands-on approach to gathering our samples may very well be slow at times, but it's safer than allowing the blundering miners to roll willy-nilly over our dig sites in their mechs, destroying everything in the process. And don't forget the escavation tools on your way out there!<br>- R.W"
|
||||
P.stamped = list(/obj/item/weapon/stamp/rd)
|
||||
P.overlays = list("paper_stamped_rd")
|
||||
src.contents += P
|
||||
|
||||
P = new()
|
||||
P.name = "Memo RE: ethical quandaries"
|
||||
P.info = "Darion-<br><br>I don't care what his rank is, our business is that of science and knowledge - questions of moral application do not come into this. Sure, so there are those who would employ the energy-wave particles my modified device has managed to abscond for their own personal gain, but I can hardly see the practical benefits of some of those things our benefactors left behind. Ward--"
|
||||
P.stamped = list(/obj/item/weapon/stamp/rd)
|
||||
P.overlays = list("paper_stamped_rd")
|
||||
src.contents += P
|
||||
|
||||
P = new()
|
||||
P.name = "READ ME! Before you people destroy any more samples"
|
||||
P.info = "how many times do i have to tell you people, these xeno-arch samples are del-i-cate, and should be handled so! careful application of a focussed, ceoncentrated heat or some corrosive liquids should clear away the extraneous carbon matter, while application of an energy beam will most decidedly destroy it entirely! W, <b>the one who signs your paychecks</b>"
|
||||
P.stamped = list(/obj/item/weapon/stamp/rd)
|
||||
P.overlays = list("paper_stamped_rd")
|
||||
src.contents += P
|
||||
|
||||
P = new()
|
||||
P.name = "Reminder regarding the anomalous material suits"
|
||||
P.info = "Do you people think the anomaly suits are cheap to come by? I'm about a hair trigger away from instituting a log book for the damn things. Only wear them if you're going out for a dig, and for god's sake don't go tramping around the station in them unless you're field testing something, R"
|
||||
P.stamped = list(/obj/item/weapon/stamp/rd)
|
||||
P.overlays = list("paper_stamped_rd")
|
||||
src.contents += P
|
||||
|
||||
//Anomaly
|
||||
|
||||
/area/anomaly
|
||||
icon_state = "anomaly"
|
||||
|
||||
/area/anomaly/hallway
|
||||
name = "Anomaly Hallway"
|
||||
|
||||
/area/anomaly/lab
|
||||
name = "Anomaly Lab"
|
||||
|
||||
/area/anomaly/outpost
|
||||
name = "Research Outpost"
|
||||
|
||||
/obj/structure/noticeboard/anomaly/New()
|
||||
notices = 5
|
||||
icon_state = "nboard05"
|
||||
|
||||
//add some memos
|
||||
var/obj/item/weapon/paper/P = new()
|
||||
P.name = "Memo RE: proper analysis procedure"
|
||||
P.info = "Rose,<br>activate <i>then</i> analyse the anomalies, your results will come so much quicker. Remember to employ basic quasi-elemental forces such as heat, energy, force and various chemical mixes - who knows why those ancient aliens made such obscure activation indices.<br><br>And don't forget your suit this time, I can't afford to have any researchers out of commision for as long as that again!.<br>Ward"
|
||||
P.stamped = list(/obj/item/weapon/stamp/rd)
|
||||
P.overlays = list("paper_stamped_rd")
|
||||
src.contents += P
|
||||
|
||||
P = new()
|
||||
P.name = "Memo RE: materials gathering"
|
||||
P.info = "Corasang,<br>the hands-on approach to gathering our samples may very well be slow at times, but it's safer than allowing the blundering miners to roll willy-nilly over our dig sites in their mechs, destroying everything in the process. And don't forget the escavation tools on your way out there!<br>- R.W"
|
||||
P.stamped = list(/obj/item/weapon/stamp/rd)
|
||||
P.overlays = list("paper_stamped_rd")
|
||||
src.contents += P
|
||||
|
||||
P = new()
|
||||
P.name = "Memo RE: ethical quandaries"
|
||||
P.info = "Darion-<br><br>I don't care what his rank is, our business is that of science and knowledge - questions of moral application do not come into this. Sure, so there are those who would employ the energy-wave particles my modified device has managed to abscond for their own personal gain, but I can hardly see the practical benefits of some of those things our benefactors left behind. Ward--"
|
||||
P.stamped = list(/obj/item/weapon/stamp/rd)
|
||||
P.overlays = list("paper_stamped_rd")
|
||||
src.contents += P
|
||||
|
||||
P = new()
|
||||
P.name = "READ ME! Before you people destroy any more samples"
|
||||
P.info = "how many times do i have to tell you people, these xeno-arch samples are del-i-cate, and should be handled so! careful application of a focussed, ceoncentrated heat or some corrosive liquids should clear away the extraneous carbon matter, while application of an energy beam will most decidedly destroy it entirely! W, <b>the one who signs your paychecks</b>"
|
||||
P.stamped = list(/obj/item/weapon/stamp/rd)
|
||||
P.overlays = list("paper_stamped_rd")
|
||||
src.contents += P
|
||||
|
||||
P = new()
|
||||
P.name = "Reminder regarding the anomalous material suits"
|
||||
P.info = "Do you people think the anomaly suits are cheap to come by? I'm about a hair trigger away from instituting a log book for the damn things. Only wear them if you're going out for a dig, and for god's sake don't go tramping around the station in them unless you're field testing something, R"
|
||||
P.stamped = list(/obj/item/weapon/stamp/rd)
|
||||
P.overlays = list("paper_stamped_rd")
|
||||
src.contents += P
|
||||
|
||||
//Anomaly
|
||||
|
||||
/area/anomaly
|
||||
icon_state = "anomaly"
|
||||
|
||||
/area/anomaly/hallway
|
||||
name = "Anomaly Hallway"
|
||||
|
||||
/area/anomaly/lab
|
||||
name = "Anomaly Lab"
|
||||
|
||||
/area/anomaly/outpost
|
||||
name = "Research Outpost"
|
||||
13
code/modules/research/xenoarchaeology/spacesuit.dm
Normal file
13
code/modules/research/xenoarchaeology/spacesuit.dm
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
/obj/item/clothing/suit/space/anomaly
|
||||
name = "Anomaly Suit"
|
||||
desc = "A sealed bio suit capable of resisting exotic alien energies and low pressure environments."
|
||||
icon_state = "engspace_suit"
|
||||
item_state = "engspace_suit"
|
||||
allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank/emergency_oxygen)
|
||||
|
||||
/obj/item/clothing/head/helmet/space/anomaly
|
||||
name = "Anomaly Hood"
|
||||
desc = "A sealed bio hood capable of resisting exotic alien energies and low pressure environments."
|
||||
icon_state = "engspace_helmet"
|
||||
item_state = "engspace_helmet"
|
||||
@@ -1,5 +1,3 @@
|
||||
//these are probably broken
|
||||
|
||||
/obj/machinery/suspension_gen
|
||||
name = "suspension field generator"
|
||||
desc = "It has stubby legs bolted up against it's body for stabilising."
|
||||
@@ -32,14 +30,14 @@
|
||||
for(var/mob/living/carbon/M in T)
|
||||
M.weakened = max(M.weakened, 3)
|
||||
cell.charge -= power_use
|
||||
if(prob(10))
|
||||
if(prob(5))
|
||||
M << "\blue [pick("You feel tingly.","You feel like floating.","It is hard to speak.","You can barely move.")]"
|
||||
|
||||
if(field_type == "silicon")
|
||||
for(var/mob/living/silicon/M in T)
|
||||
M.weakened = max(M.weakened, 3)
|
||||
cell.charge -= power_use
|
||||
if(prob(10))
|
||||
if(prob(5))
|
||||
M << "\blue [pick("You feel tingly.","You feel like floating.","It is hard to speak.","You can barely move.")]"
|
||||
|
||||
for(var/obj/item/I in T)
|
||||
@@ -51,7 +49,7 @@
|
||||
for(var/mob/living/simple_animal/M in T)
|
||||
M.weakened = max(M.weakened, 3)
|
||||
cell.charge -= power_use
|
||||
if(prob(10))
|
||||
if(prob(5))
|
||||
M << "\blue [pick("You feel tingly.","You feel like floating.","It is hard to speak.","You can barely move.")]"
|
||||
|
||||
if(cell.charge <= 0)
|
||||
|
||||
@@ -1,318 +1,318 @@
|
||||
|
||||
//cael - some changes here. the analysis pad is entirely new
|
||||
|
||||
/obj/machinery/artifact_analyser
|
||||
name = "Artifact Analyser"
|
||||
desc = "Studies the structure of artifacts to discover their uses."
|
||||
icon = 'virology.dmi'
|
||||
icon_state = "analyser"
|
||||
anchored = 1
|
||||
density = 1
|
||||
var/working = 0
|
||||
var/accuO = 0
|
||||
var/accuT = 0
|
||||
var/accuE1 = 0
|
||||
var/accuE2 = 0
|
||||
var/aorigin = "None"
|
||||
var/atrigger = "None"
|
||||
var/aeffect1 = "None"
|
||||
var/aeffect2 = "None"
|
||||
var/list/origin_bonuses
|
||||
var/list/trigger_bonuses
|
||||
var/list/function_bonuses
|
||||
var/list/range_bonuses
|
||||
var/cur_id = ""
|
||||
var/scan_num = 0
|
||||
var/obj/machinery/artifact/cur_artifact = null
|
||||
var/obj/machinery/analyser_pad/owned_pad = null
|
||||
var/list/allorigins = list("Ancient Robots","Martian","Wizard Federation","Extradimensional","Precursor")
|
||||
var/list/alltriggers = list("Contact with Living Organism","Heavy Impact","Contact with Energy Source","Contact with Hydrogen","Contact with Corrosive Substance","Contact with Volatile Substance","Contact with Toxins","Exposure to Heat")
|
||||
var/list/alleffects = list("Healing Device","Anti-biological Weapon","Non-lethal Stunning Trap","Mechanoid Repair Module","Mechanoid Deconstruction Device","Power Generator","Power Drain","Stellar Mineral Attractor","Agriculture Regulator","Shield Generator","Space-Time Displacer")
|
||||
var/list/allranges = list("Constant Short-Range Energy Field","Medium Range Energy Pulses","Long Range Energy Pulses","Extreme Range Energy Pulses","Requires contact with subject")
|
||||
|
||||
/obj/machinery/artifact_analyser/New()
|
||||
..()
|
||||
origin_bonuses = new/list()
|
||||
origin_bonuses["ancient"] = 0
|
||||
origin_bonuses["martian"] = 0
|
||||
origin_bonuses["wizard"] = 0
|
||||
origin_bonuses["eldritch"] = 0
|
||||
origin_bonuses["precursor"] = 0
|
||||
trigger_bonuses = new/list()
|
||||
trigger_bonuses["ancient"] = 0
|
||||
trigger_bonuses["martian"] = 0
|
||||
trigger_bonuses["wizard"] = 0
|
||||
trigger_bonuses["eldritch"] = 0
|
||||
trigger_bonuses["precursor"] = 0
|
||||
function_bonuses = new/list()
|
||||
function_bonuses["ancient"] = 0
|
||||
function_bonuses["martian"] = 0
|
||||
function_bonuses["wizard"] = 0
|
||||
function_bonuses["eldritch"] = 0
|
||||
function_bonuses["precursor"] = 0
|
||||
range_bonuses = new/list()
|
||||
range_bonuses["ancient"] = 0
|
||||
range_bonuses["martian"] = 0
|
||||
range_bonuses["wizard"] = 0
|
||||
range_bonuses["eldritch"] = 0
|
||||
range_bonuses["precursor"] = 0
|
||||
//
|
||||
spawn(10)
|
||||
owned_pad = locate() in orange(1, src)
|
||||
|
||||
/obj/machinery/artifact_analyser/attack_hand(var/mob/user as mob)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
user.machine = src
|
||||
var/dat = "<B>Artifact Analyser</B><BR>"
|
||||
dat += "<HR><BR>"
|
||||
if(!owned_pad)
|
||||
dat += "<B><font color=red>Unable to locate analysis pad.</font><BR></b>"
|
||||
dat += "<HR><BR>"
|
||||
else if (!src.working)
|
||||
dat += "<B>Artifact ID:</B> [cur_id]<BR>"
|
||||
dat += "<B>Artifact Origin:</B> [aorigin] ([accuO]%)<BR>"
|
||||
dat += "<B>Activation Trigger:</B> [atrigger] ([accuT]%)<BR>"
|
||||
dat += "<B>Artifact Function:</B> [aeffect1] ([accuE1]%)<BR>"
|
||||
dat += "<B>Artifact Range:</B> [aeffect2] ([accuE2]%)<BR><BR>"
|
||||
dat += "<HR><BR>"
|
||||
dat += "Artifact ID is determined from unique energy emission signatures.<br>"
|
||||
dat += "<A href='?src=\ref[src];analyse=1'>Analyse Artifact (Scan number #[scan_num+1])</a><BR>"
|
||||
dat += "<A href='?src=\ref[src];upload=1'>Upload/update artifact scan</a><BR>"
|
||||
dat += "<A href='?src=\ref[src];print=1'>Print Page</a><BR>"
|
||||
else
|
||||
dat += "<B>Please wait. Analysis in progress.</B><BR>"
|
||||
dat += "<HR><BR>"
|
||||
//
|
||||
dat += "<A href='?src=\ref[src];close=1'>Close<BR>"
|
||||
user << browse(dat, "window=artanalyser;size=450x500")
|
||||
onclose(user, "artanalyser")
|
||||
|
||||
/obj/machinery/artifact_analyser/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
use_power(350)
|
||||
//
|
||||
if(!owned_pad)
|
||||
for(var/obj/machinery/analyser_pad/pad in range(1))
|
||||
owned_pad = pad
|
||||
break
|
||||
|
||||
/obj/machinery/artifact_analyser/proc/AA_FailedAnalysis(var/failtype)
|
||||
switch(failtype)
|
||||
if(1)
|
||||
src.aorigin = "Failed to Identify"
|
||||
if (prob(20)) src.aorigin = pick(src.allorigins)
|
||||
if(2)
|
||||
src.atrigger = "Failed to Identify"
|
||||
if (prob(20)) src.atrigger = pick(src.alltriggers)
|
||||
if(3)
|
||||
src.aeffect1 = "Failed to Identify"
|
||||
if (prob(20)) src.aeffect1 = pick(src.alleffects)
|
||||
if(4)
|
||||
src.aeffect2 = "Failed to Identify"
|
||||
if (prob(20)) src.aeffect2 = pick(src.allranges)
|
||||
|
||||
/obj/machinery/artifact_analyser/proc/AA_Analyse()
|
||||
if(!cur_artifact)
|
||||
return
|
||||
src.accuO = 5 + rand(0,10) + origin_bonuses[cur_artifact.origin] + cur_artifact.activated * 50
|
||||
src.accuT = 5 + rand(0,10) + trigger_bonuses[cur_artifact.origin] + cur_artifact.activated * 50
|
||||
src.accuE1 = 5 + rand(0,10) + function_bonuses[cur_artifact.origin] + cur_artifact.activated * 50
|
||||
src.accuE2 = 5 + rand(0,10) + range_bonuses[cur_artifact.origin] + cur_artifact.activated * 50
|
||||
|
||||
//keep any correctly determined properties the same
|
||||
var/origin_correct = 0
|
||||
var/trigger_correct = 0
|
||||
var/function_correct = 0
|
||||
var/range_correct = 0
|
||||
if(cur_id == cur_artifact.display_id)
|
||||
if(src.aorigin == cur_artifact.origin)
|
||||
origin_correct = 1
|
||||
|
||||
if(src.atrigger == cur_artifact.my_effect.trigger)
|
||||
trigger_correct = 1
|
||||
else if(src.atrigger == cur_artifact.my_effect.triggerX)
|
||||
trigger_correct = 1
|
||||
|
||||
if(src.aeffect1 == cur_artifact.my_effect.effecttype)
|
||||
function_correct = 1
|
||||
|
||||
if(src.aeffect2 == cur_artifact.my_effect.effectmode)
|
||||
range_correct = 1
|
||||
|
||||
if (src.accuO > 100) src.accuO = 100
|
||||
if (src.accuT > 100) src.accuT = 100
|
||||
if (src.accuE1 > 100) src.accuE1 = 100
|
||||
if (src.accuE2 > 100) src.accuE2 = 100
|
||||
// Roll to generate report
|
||||
if (prob(accuO) || origin_correct)
|
||||
switch(cur_artifact.origin)
|
||||
if("ancient") src.aorigin = "Ancient Robots"
|
||||
if("martian") src.aorigin = "Martian"
|
||||
if("wizard") src.aorigin = "Wizard Federation"
|
||||
if("eldritch") src.aorigin = "Extradimensional"
|
||||
if("precursor") src.aorigin = "Precursor"
|
||||
else src.aorigin = "Unknown Origin"
|
||||
origin_bonuses[cur_artifact.origin] += 10
|
||||
else
|
||||
AA_FailedAnalysis(1)
|
||||
origin_bonuses[cur_artifact.origin] += 5
|
||||
if (prob(accuT) || trigger_correct)
|
||||
switch(cur_artifact.my_effect.trigger)
|
||||
if("touch") src.atrigger = "Contact with Living Organism"
|
||||
if("force") src.atrigger = "Heavy Impact"
|
||||
if("energy") src.atrigger = "Contact with Energy Source"
|
||||
if("chemical")
|
||||
switch(cur_artifact.my_effect.triggerX)
|
||||
if("hydrogen") src.atrigger = "Contact with Hydrogen"
|
||||
if("corrosive") src.atrigger = "Contact with Corrosive Substance"
|
||||
if("volatile") src.atrigger = "Contact with Volatile Substance"
|
||||
if("toxin") src.atrigger = "Contact with Toxins"
|
||||
if("heat") src.atrigger = "Exposure to Heat"
|
||||
else src.atrigger = "Unknown Trigger"
|
||||
trigger_bonuses[cur_artifact.origin] += 5
|
||||
else
|
||||
AA_FailedAnalysis(2)
|
||||
trigger_bonuses[cur_artifact.origin] += 1
|
||||
if (prob(accuE1) || function_correct)
|
||||
switch(cur_artifact.my_effect.effecttype)
|
||||
if("healing") src.aeffect1 = "Healing Device"
|
||||
if("injure") src.aeffect1 = "Anti-biological Weapon"
|
||||
// if("stun") src.aeffect1 = "Non-lethal Stunning Trap"
|
||||
if("roboheal") src.aeffect1 = "Mechanoid Repair Module"
|
||||
if("robohurt") src.aeffect1 = "Mechanoid Deconstruction Device"
|
||||
if("cellcharge") src.aeffect1 = "Power Generator"
|
||||
if("celldrain") src.aeffect1 = "Power Drain"
|
||||
if("planthelper") src.aeffect1 = "Agriculture Regulator"
|
||||
if("forcefield") src.aeffect1 = "Shield Generator"
|
||||
if("teleport") src.aeffect1 = "Space-Time Displacer"
|
||||
else src.aeffect1 = "Unknown Effect"
|
||||
function_bonuses[cur_artifact.origin] += 5
|
||||
else
|
||||
AA_FailedAnalysis(3)
|
||||
function_bonuses[cur_artifact.origin] += 1
|
||||
if (prob(accuE2) || range_correct)
|
||||
switch(cur_artifact.my_effect.effectmode)
|
||||
if("aura") src.aeffect2 = "Constant Short-Range Energy Field"
|
||||
if("pulse")
|
||||
if(cur_artifact.my_effect.aurarange > 7) src.aeffect2 = "Long Range Energy Pulses"
|
||||
else src.aeffect2 = "Medium Range Energy Pulses"
|
||||
if("worldpulse") src.aeffect2 = "Extreme Range Energy Pulses"
|
||||
if("contact") src.aeffect2 = "Requires contact with subject"
|
||||
else src.aeffect2 = "Unknown Range"
|
||||
range_bonuses[cur_artifact.origin] += 5
|
||||
else
|
||||
AA_FailedAnalysis(4)
|
||||
range_bonuses[cur_artifact.origin] += 1
|
||||
|
||||
cur_artifact.name = "alien artifact ([cur_artifact.display_id])"
|
||||
cur_artifact.desc = "A large alien device. It has a small tag near the bottom that reads \"[cur_artifact.display_id]\"."
|
||||
cur_id = cur_artifact.display_id
|
||||
cur_artifact.my_effect.artifact_id = cur_artifact.display_id
|
||||
|
||||
/obj/machinery/artifact_analyser/Topic(href, href_list)
|
||||
|
||||
if(href_list["analyse"])
|
||||
if(owned_pad)
|
||||
var/turf/pad_turf = get_turf(owned_pad)
|
||||
var/findarti = 0
|
||||
for(var/obj/machinery/artifact/A in pad_turf.contents)
|
||||
findarti++
|
||||
cur_artifact = A
|
||||
if (findarti == 1)
|
||||
if(cur_artifact && cur_artifact.being_used)
|
||||
var/message = "<b>[src]</b> states, \"Cannot analyse. Excess energy drain is disrupting signal.\""
|
||||
src.visible_message(message, message)
|
||||
else
|
||||
cur_artifact.anchored = 1
|
||||
cur_artifact.being_used = 1
|
||||
src.working = 1
|
||||
src.icon_state = "analyser_processing"
|
||||
var/time = rand(30,50) + max(0, 300 - scan_num * 10)
|
||||
/*for(var/i = artifact_research.starting_tier, i <= artifact_research.max_tiers, i++)
|
||||
for(var/datum/artiresearch/R in artifact_research.researched_items[i])
|
||||
if (R.bonustype == "analyser") time -= R.bonusTime*/
|
||||
time *= 10
|
||||
var/message = "<b>[src]</b> states, \"Commencing analysis.\""
|
||||
src.visible_message(message, message)
|
||||
use_power(500)
|
||||
spawn(time)
|
||||
src.working = 0
|
||||
icon_state = "analyser"
|
||||
cur_artifact.anchored = 0
|
||||
cur_artifact.being_used = 0
|
||||
if(cur_artifact.loc == pad_turf)
|
||||
AA_Analyse()
|
||||
scan_num++
|
||||
message = "<b>[src]</b> states, \"Analysis complete.\""
|
||||
src.visible_message(message, message)
|
||||
use_power(500)
|
||||
else if (findarti > 1)
|
||||
var/message = "<b>[src]</b> states, \"Cannot analyse. Error isolating energy signature.\""
|
||||
src.visible_message(message, message)
|
||||
else
|
||||
var/message = "<b>[src]</b> states, \"Cannot analyse. No noteworthy energy signature isolated.\""
|
||||
src.visible_message(message, message)
|
||||
|
||||
if(href_list["upload"] && cur_id != "")
|
||||
//add new datum to every DB in the world
|
||||
for(var/obj/machinery/computer/artifact_database/DB in world)
|
||||
var/update = 0
|
||||
for(var/datum/catalogued_artifact/CA in DB.catalogued_artifacts)
|
||||
if(CA.display_id == cur_id)
|
||||
//already there, so update it
|
||||
update = 1
|
||||
CA.origin = aorigin + " ([accuO]%)"
|
||||
CA.trigger = atrigger + " ([accuT]%)"
|
||||
CA.effecttype = aeffect1 + " ([accuE1]%)"
|
||||
CA.effectmode = aeffect2 + " ([accuE2]%)"
|
||||
if(!update)
|
||||
//not there, so add it
|
||||
var/datum/catalogued_artifact/CA = new()
|
||||
CA.display_id = cur_id
|
||||
CA.origin = aorigin + " ([accuO]%)"
|
||||
CA.trigger = atrigger + " ([accuT]%)"
|
||||
CA.effecttype = aeffect1 + " ([accuE1]%)"
|
||||
CA.effectmode = aeffect2 + " ([accuE2]%)"
|
||||
DB.catalogued_artifacts.Add(CA)
|
||||
use_power(100)
|
||||
|
||||
if(href_list["print"])
|
||||
var/r = "Artifact Analysis Report (Scan #[scan_num])<hr>"
|
||||
r += "<B>Artifact ID:</B> [cur_id] (determined from unique energy emission signatures)<BR>"
|
||||
r += "<B>Artifact Origin:</B> [aorigin] ([accuO]%)<BR>"
|
||||
r += "<B>Activation Trigger:</B> [atrigger] ([accuT]%)<BR>"
|
||||
r += "<B>Artifact Function:</B> [aeffect1] ([accuE1]%)<BR>"
|
||||
r += "<B>Artifact Range:</B> [aeffect2] ([accuE2]%)<BR><BR>"
|
||||
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(src.loc)
|
||||
P.name = "Artifact Analysis Report #[scan_num]"
|
||||
P.info = r
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\icon[src] \blue The [src.name] prints a sheet of paper", 3)
|
||||
use_power(10)
|
||||
|
||||
if(href_list["close"])
|
||||
usr << browse(null, "window=artanalyser")
|
||||
usr.machine = null
|
||||
|
||||
src.updateDialog()
|
||||
|
||||
//stick artifacts onto this then switch the analyser on
|
||||
/obj/machinery/analyser_pad
|
||||
name = "artifact analysis pad"
|
||||
desc = "Studies the structure of artifacts to discover their uses."
|
||||
icon = 'stationobjs.dmi'
|
||||
icon_state = "tele0"
|
||||
anchored = 1
|
||||
density = 0
|
||||
|
||||
/obj/machinery/analyser_pad/New()
|
||||
..()
|
||||
/*spawn(10)
|
||||
for(var/obj/machinery/artifact_analyser/analyser in orange(1))
|
||||
world << "pad found analyser"
|
||||
if(!analyser.owned_pad)
|
||||
analyser.owned_pad = src
|
||||
world << "pad set analyser to self"
|
||||
break*/
|
||||
|
||||
//cael - some changes here. the analysis pad is entirely new
|
||||
|
||||
/obj/machinery/artifact_analyser
|
||||
name = "Artifact Analyser"
|
||||
desc = "Studies the structure of artifacts to discover their uses."
|
||||
icon = 'virology.dmi'
|
||||
icon_state = "analyser"
|
||||
anchored = 1
|
||||
density = 1
|
||||
var/working = 0
|
||||
var/accuO = 0
|
||||
var/accuT = 0
|
||||
var/accuE1 = 0
|
||||
var/accuE2 = 0
|
||||
var/aorigin = "None"
|
||||
var/atrigger = "None"
|
||||
var/aeffect1 = "None"
|
||||
var/aeffect2 = "None"
|
||||
var/list/origin_bonuses
|
||||
var/list/trigger_bonuses
|
||||
var/list/function_bonuses
|
||||
var/list/range_bonuses
|
||||
var/cur_id = ""
|
||||
var/scan_num = 0
|
||||
var/obj/machinery/artifact/cur_artifact = null
|
||||
var/obj/machinery/analyser_pad/owned_pad = null
|
||||
var/list/allorigins = list("Ancient Robots","Martian","Wizard Federation","Extradimensional","Precursor")
|
||||
var/list/alltriggers = list("Contact with Living Organism","Heavy Impact","Contact with Energy Source","Contact with Hydrogen","Contact with Corrosive Substance","Contact with Volatile Substance","Contact with Toxins","Exposure to Heat")
|
||||
var/list/alleffects = list("Healing Device","Anti-biological Weapon","Non-lethal Stunning Trap","Mechanoid Repair Module","Mechanoid Deconstruction Device","Power Generator","Power Drain","Stellar Mineral Attractor","Agriculture Regulator","Shield Generator","Space-Time Displacer")
|
||||
var/list/allranges = list("Constant Short-Range Energy Field","Medium Range Energy Pulses","Long Range Energy Pulses","Extreme Range Energy Pulses","Requires contact with subject")
|
||||
|
||||
/obj/machinery/artifact_analyser/New()
|
||||
..()
|
||||
origin_bonuses = new/list()
|
||||
origin_bonuses["ancient"] = 0
|
||||
origin_bonuses["martian"] = 0
|
||||
origin_bonuses["wizard"] = 0
|
||||
origin_bonuses["eldritch"] = 0
|
||||
origin_bonuses["precursor"] = 0
|
||||
trigger_bonuses = new/list()
|
||||
trigger_bonuses["ancient"] = 0
|
||||
trigger_bonuses["martian"] = 0
|
||||
trigger_bonuses["wizard"] = 0
|
||||
trigger_bonuses["eldritch"] = 0
|
||||
trigger_bonuses["precursor"] = 0
|
||||
function_bonuses = new/list()
|
||||
function_bonuses["ancient"] = 0
|
||||
function_bonuses["martian"] = 0
|
||||
function_bonuses["wizard"] = 0
|
||||
function_bonuses["eldritch"] = 0
|
||||
function_bonuses["precursor"] = 0
|
||||
range_bonuses = new/list()
|
||||
range_bonuses["ancient"] = 0
|
||||
range_bonuses["martian"] = 0
|
||||
range_bonuses["wizard"] = 0
|
||||
range_bonuses["eldritch"] = 0
|
||||
range_bonuses["precursor"] = 0
|
||||
//
|
||||
spawn(10)
|
||||
owned_pad = locate() in orange(1, src)
|
||||
|
||||
/obj/machinery/artifact_analyser/attack_hand(var/mob/user as mob)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
user.machine = src
|
||||
var/dat = "<B>Artifact Analyser</B><BR>"
|
||||
dat += "<HR><BR>"
|
||||
if(!owned_pad)
|
||||
dat += "<B><font color=red>Unable to locate analysis pad.</font><BR></b>"
|
||||
dat += "<HR><BR>"
|
||||
else if (!src.working)
|
||||
dat += "<B>Artifact ID:</B> [cur_id]<BR>"
|
||||
dat += "<B>Artifact Origin:</B> [aorigin] ([accuO]%)<BR>"
|
||||
dat += "<B>Activation Trigger:</B> [atrigger] ([accuT]%)<BR>"
|
||||
dat += "<B>Artifact Function:</B> [aeffect1] ([accuE1]%)<BR>"
|
||||
dat += "<B>Artifact Range:</B> [aeffect2] ([accuE2]%)<BR><BR>"
|
||||
dat += "<HR><BR>"
|
||||
dat += "Artifact ID is determined from unique energy emission signatures.<br>"
|
||||
dat += "<A href='?src=\ref[src];analyse=1'>Analyse Artifact (Scan number #[scan_num+1])</a><BR>"
|
||||
dat += "<A href='?src=\ref[src];upload=1'>Upload/update artifact scan</a><BR>"
|
||||
dat += "<A href='?src=\ref[src];print=1'>Print Page</a><BR>"
|
||||
else
|
||||
dat += "<B>Please wait. Analysis in progress.</B><BR>"
|
||||
dat += "<HR><BR>"
|
||||
//
|
||||
dat += "<A href='?src=\ref[src];close=1'>Close<BR>"
|
||||
user << browse(dat, "window=artanalyser;size=450x500")
|
||||
onclose(user, "artanalyser")
|
||||
|
||||
/obj/machinery/artifact_analyser/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
use_power(350)
|
||||
//
|
||||
if(!owned_pad)
|
||||
for(var/obj/machinery/analyser_pad/pad in range(1))
|
||||
owned_pad = pad
|
||||
break
|
||||
|
||||
/obj/machinery/artifact_analyser/proc/AA_FailedAnalysis(var/failtype)
|
||||
switch(failtype)
|
||||
if(1)
|
||||
src.aorigin = "Failed to Identify"
|
||||
if (prob(20)) src.aorigin = pick(src.allorigins)
|
||||
if(2)
|
||||
src.atrigger = "Failed to Identify"
|
||||
if (prob(20)) src.atrigger = pick(src.alltriggers)
|
||||
if(3)
|
||||
src.aeffect1 = "Failed to Identify"
|
||||
if (prob(20)) src.aeffect1 = pick(src.alleffects)
|
||||
if(4)
|
||||
src.aeffect2 = "Failed to Identify"
|
||||
if (prob(20)) src.aeffect2 = pick(src.allranges)
|
||||
|
||||
/obj/machinery/artifact_analyser/proc/AA_Analyse()
|
||||
if(!cur_artifact)
|
||||
return
|
||||
src.accuO = 5 + rand(0,10) + origin_bonuses[cur_artifact.origin] + cur_artifact.activated * 50
|
||||
src.accuT = 5 + rand(0,10) + trigger_bonuses[cur_artifact.origin] + cur_artifact.activated * 50
|
||||
src.accuE1 = 5 + rand(0,10) + function_bonuses[cur_artifact.origin] + cur_artifact.activated * 50
|
||||
src.accuE2 = 5 + rand(0,10) + range_bonuses[cur_artifact.origin] + cur_artifact.activated * 50
|
||||
|
||||
//keep any correctly determined properties the same
|
||||
var/origin_correct = 0
|
||||
var/trigger_correct = 0
|
||||
var/function_correct = 0
|
||||
var/range_correct = 0
|
||||
if(cur_id == cur_artifact.display_id)
|
||||
if(src.aorigin == cur_artifact.origin)
|
||||
origin_correct = 1
|
||||
|
||||
if(src.atrigger == cur_artifact.my_effect.trigger)
|
||||
trigger_correct = 1
|
||||
else if(src.atrigger == cur_artifact.my_effect.triggerX)
|
||||
trigger_correct = 1
|
||||
|
||||
if(src.aeffect1 == cur_artifact.my_effect.effecttype)
|
||||
function_correct = 1
|
||||
|
||||
if(src.aeffect2 == cur_artifact.my_effect.effectmode)
|
||||
range_correct = 1
|
||||
|
||||
if (src.accuO > 100) src.accuO = 100
|
||||
if (src.accuT > 100) src.accuT = 100
|
||||
if (src.accuE1 > 100) src.accuE1 = 100
|
||||
if (src.accuE2 > 100) src.accuE2 = 100
|
||||
// Roll to generate report
|
||||
if (prob(accuO) || origin_correct)
|
||||
switch(cur_artifact.origin)
|
||||
if("ancient") src.aorigin = "Ancient Robots"
|
||||
if("martian") src.aorigin = "Martian"
|
||||
if("wizard") src.aorigin = "Wizard Federation"
|
||||
if("eldritch") src.aorigin = "Extradimensional"
|
||||
if("precursor") src.aorigin = "Precursor"
|
||||
else src.aorigin = "Unknown Origin"
|
||||
origin_bonuses[cur_artifact.origin] += 10
|
||||
else
|
||||
AA_FailedAnalysis(1)
|
||||
origin_bonuses[cur_artifact.origin] += 5
|
||||
if (prob(accuT) || trigger_correct)
|
||||
switch(cur_artifact.my_effect.trigger)
|
||||
if("touch") src.atrigger = "Contact with Living Organism"
|
||||
if("force") src.atrigger = "Heavy Impact"
|
||||
if("energy") src.atrigger = "Contact with Energy Source"
|
||||
if("chemical")
|
||||
switch(cur_artifact.my_effect.triggerX)
|
||||
if("hydrogen") src.atrigger = "Contact with Hydrogen"
|
||||
if("corrosive") src.atrigger = "Contact with Corrosive Substance"
|
||||
if("volatile") src.atrigger = "Contact with Volatile Substance"
|
||||
if("toxin") src.atrigger = "Contact with Toxins"
|
||||
if("heat") src.atrigger = "Exposure to Heat"
|
||||
else src.atrigger = "Unknown Trigger"
|
||||
trigger_bonuses[cur_artifact.origin] += 5
|
||||
else
|
||||
AA_FailedAnalysis(2)
|
||||
trigger_bonuses[cur_artifact.origin] += 1
|
||||
if (prob(accuE1) || function_correct)
|
||||
switch(cur_artifact.my_effect.effecttype)
|
||||
if("healing") src.aeffect1 = "Healing Device"
|
||||
if("injure") src.aeffect1 = "Anti-biological Weapon"
|
||||
// if("stun") src.aeffect1 = "Non-lethal Stunning Trap"
|
||||
if("roboheal") src.aeffect1 = "Mechanoid Repair Module"
|
||||
if("robohurt") src.aeffect1 = "Mechanoid Deconstruction Device"
|
||||
if("cellcharge") src.aeffect1 = "Power Generator"
|
||||
if("celldrain") src.aeffect1 = "Power Drain"
|
||||
if("planthelper") src.aeffect1 = "Agriculture Regulator"
|
||||
if("forcefield") src.aeffect1 = "Shield Generator"
|
||||
if("teleport") src.aeffect1 = "Space-Time Displacer"
|
||||
else src.aeffect1 = "Unknown Effect"
|
||||
function_bonuses[cur_artifact.origin] += 5
|
||||
else
|
||||
AA_FailedAnalysis(3)
|
||||
function_bonuses[cur_artifact.origin] += 1
|
||||
if (prob(accuE2) || range_correct)
|
||||
switch(cur_artifact.my_effect.effectmode)
|
||||
if("aura") src.aeffect2 = "Constant Short-Range Energy Field"
|
||||
if("pulse")
|
||||
if(cur_artifact.my_effect.aurarange > 7) src.aeffect2 = "Long Range Energy Pulses"
|
||||
else src.aeffect2 = "Medium Range Energy Pulses"
|
||||
if("worldpulse") src.aeffect2 = "Extreme Range Energy Pulses"
|
||||
if("contact") src.aeffect2 = "Requires contact with subject"
|
||||
else src.aeffect2 = "Unknown Range"
|
||||
range_bonuses[cur_artifact.origin] += 5
|
||||
else
|
||||
AA_FailedAnalysis(4)
|
||||
range_bonuses[cur_artifact.origin] += 1
|
||||
|
||||
cur_artifact.name = "alien artifact ([cur_artifact.display_id])"
|
||||
cur_artifact.desc = "A large alien device. It has a small tag near the bottom that reads \"[cur_artifact.display_id]\"."
|
||||
cur_id = cur_artifact.display_id
|
||||
cur_artifact.my_effect.artifact_id = cur_artifact.display_id
|
||||
|
||||
/obj/machinery/artifact_analyser/Topic(href, href_list)
|
||||
|
||||
if(href_list["analyse"])
|
||||
if(owned_pad)
|
||||
var/turf/pad_turf = get_turf(owned_pad)
|
||||
var/findarti = 0
|
||||
for(var/obj/machinery/artifact/A in pad_turf.contents)
|
||||
findarti++
|
||||
cur_artifact = A
|
||||
if (findarti == 1)
|
||||
if(cur_artifact && cur_artifact.being_used)
|
||||
var/message = "<b>[src]</b> states, \"Cannot analyse. Excess energy drain is disrupting signal.\""
|
||||
src.visible_message(message, message)
|
||||
else
|
||||
cur_artifact.anchored = 1
|
||||
cur_artifact.being_used = 1
|
||||
src.working = 1
|
||||
src.icon_state = "analyser_processing"
|
||||
var/time = rand(30,50) + max(0, 300 - scan_num * 10)
|
||||
/*for(var/i = artifact_research.starting_tier, i <= artifact_research.max_tiers, i++)
|
||||
for(var/datum/artiresearch/R in artifact_research.researched_items[i])
|
||||
if (R.bonustype == "analyser") time -= R.bonusTime*/
|
||||
time *= 10
|
||||
var/message = "<b>[src]</b> states, \"Commencing analysis.\""
|
||||
src.visible_message(message, message)
|
||||
use_power(500)
|
||||
spawn(time)
|
||||
src.working = 0
|
||||
icon_state = "analyser"
|
||||
cur_artifact.anchored = 0
|
||||
cur_artifact.being_used = 0
|
||||
if(cur_artifact.loc == pad_turf)
|
||||
AA_Analyse()
|
||||
scan_num++
|
||||
message = "<b>[src]</b> states, \"Analysis complete.\""
|
||||
src.visible_message(message, message)
|
||||
use_power(500)
|
||||
else if (findarti > 1)
|
||||
var/message = "<b>[src]</b> states, \"Cannot analyse. Error isolating energy signature.\""
|
||||
src.visible_message(message, message)
|
||||
else
|
||||
var/message = "<b>[src]</b> states, \"Cannot analyse. No noteworthy energy signature isolated.\""
|
||||
src.visible_message(message, message)
|
||||
|
||||
if(href_list["upload"] && cur_id != "")
|
||||
//add new datum to every DB in the world
|
||||
for(var/obj/machinery/computer/artifact_database/DB in world)
|
||||
var/update = 0
|
||||
for(var/datum/catalogued_artifact/CA in DB.catalogued_artifacts)
|
||||
if(CA.display_id == cur_id)
|
||||
//already there, so update it
|
||||
update = 1
|
||||
CA.origin = aorigin + " ([accuO]%)"
|
||||
CA.trigger = atrigger + " ([accuT]%)"
|
||||
CA.effecttype = aeffect1 + " ([accuE1]%)"
|
||||
CA.effectmode = aeffect2 + " ([accuE2]%)"
|
||||
if(!update)
|
||||
//not there, so add it
|
||||
var/datum/catalogued_artifact/CA = new()
|
||||
CA.display_id = cur_id
|
||||
CA.origin = aorigin + " ([accuO]%)"
|
||||
CA.trigger = atrigger + " ([accuT]%)"
|
||||
CA.effecttype = aeffect1 + " ([accuE1]%)"
|
||||
CA.effectmode = aeffect2 + " ([accuE2]%)"
|
||||
DB.catalogued_artifacts.Add(CA)
|
||||
use_power(100)
|
||||
|
||||
if(href_list["print"])
|
||||
var/r = "Artifact Analysis Report (Scan #[scan_num])<hr>"
|
||||
r += "<B>Artifact ID:</B> [cur_id] (determined from unique energy emission signatures)<BR>"
|
||||
r += "<B>Artifact Origin:</B> [aorigin] ([accuO]%)<BR>"
|
||||
r += "<B>Activation Trigger:</B> [atrigger] ([accuT]%)<BR>"
|
||||
r += "<B>Artifact Function:</B> [aeffect1] ([accuE1]%)<BR>"
|
||||
r += "<B>Artifact Range:</B> [aeffect2] ([accuE2]%)<BR><BR>"
|
||||
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(src.loc)
|
||||
P.name = "Artifact Analysis Report #[scan_num]"
|
||||
P.info = r
|
||||
for(var/mob/O in hearers(src, null))
|
||||
O.show_message("\icon[src] \blue The [src.name] prints a sheet of paper", 3)
|
||||
use_power(10)
|
||||
|
||||
if(href_list["close"])
|
||||
usr << browse(null, "window=artanalyser")
|
||||
usr.machine = null
|
||||
|
||||
src.updateDialog()
|
||||
|
||||
//stick artifacts onto this then switch the analyser on
|
||||
/obj/machinery/analyser_pad
|
||||
name = "artifact analysis pad"
|
||||
desc = "Studies the structure of artifacts to discover their uses."
|
||||
icon = 'stationobjs.dmi'
|
||||
icon_state = "tele0"
|
||||
anchored = 1
|
||||
density = 0
|
||||
|
||||
/obj/machinery/analyser_pad/New()
|
||||
..()
|
||||
/*spawn(10)
|
||||
for(var/obj/machinery/artifact_analyser/analyser in orange(1))
|
||||
world << "pad found analyser"
|
||||
if(!analyser.owned_pad)
|
||||
analyser.owned_pad = src
|
||||
world << "pad set analyser to self"
|
||||
break*/
|
||||
@@ -1,58 +1,58 @@
|
||||
|
||||
/datum/catalogued_artifact
|
||||
var/trigger = "touch" // What activates it?
|
||||
var/effecttype = "healing" // What does it do?
|
||||
var/effectmode = "aura" // How does it carry out the effect?
|
||||
var/display_id = "" // Artifact ID to display once successfully scanned
|
||||
var/origin = ""
|
||||
|
||||
/obj/machinery/computer/artifact_database
|
||||
name = "Artifact Database"
|
||||
icon_state = "rdcomp"
|
||||
var/list/catalogued_artifacts
|
||||
|
||||
/obj/machinery/computer/artifact_database/New()
|
||||
..()
|
||||
catalogued_artifacts = new/list
|
||||
|
||||
/obj/machinery/computer/artifact_database/Topic(href, href_list)
|
||||
..()
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=artifact_db")
|
||||
usr.machine = null
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/computer/artifact_database/process()
|
||||
..()
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/computer/artifact_database/interact(mob/user)
|
||||
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
|
||||
if (!istype(user, /mob/living/silicon))
|
||||
user.machine = null
|
||||
user << browse(null, "window=artifact_db")
|
||||
return
|
||||
var/t = "<B>Artifact Database</B><BR>"
|
||||
t += "<hr>"
|
||||
for(var/datum/catalogued_artifact/CA in catalogued_artifacts)
|
||||
t += "<B>Artifact ID:</B> [CA.display_id] (determined from unique energy emission signatures)<BR>"
|
||||
t += "<B>Artifact Origin:</B> [CA.origin]<BR>"
|
||||
t += "<B>Activation Trigger:</B> [CA.trigger]<BR>"
|
||||
t += "<B>Artifact Function:</B> [CA.effecttype]<BR>"
|
||||
t += "<B>Artifact Range:</B> [CA.effectmode]<BR><BR>"
|
||||
t += "<hr>"
|
||||
t += "<A href='?src=\ref[src];refresh=1'>Refresh</A> <A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
user << browse(t, "window=artifact_db;size=500x800")
|
||||
user.machine = src
|
||||
|
||||
/*
|
||||
/datum/artifact_effect
|
||||
var/origin = null // Used in the randomisation/research of the artifact.
|
||||
var/trigger = "touch" // What activates it?
|
||||
var/triggerX = "none" // Used for more varied triggers
|
||||
var/effecttype = "healing" // What does it do?
|
||||
var/effectmode = "aura" // How does it carry out the effect?
|
||||
var/aurarange = 4 // How far the artifact will extend an aura effect.
|
||||
var/display_id = "" // Artifact ID to display once successfully scanned
|
||||
var/list/created_field
|
||||
|
||||
/datum/catalogued_artifact
|
||||
var/trigger = "touch" // What activates it?
|
||||
var/effecttype = "healing" // What does it do?
|
||||
var/effectmode = "aura" // How does it carry out the effect?
|
||||
var/display_id = "" // Artifact ID to display once successfully scanned
|
||||
var/origin = ""
|
||||
|
||||
/obj/machinery/computer/artifact_database
|
||||
name = "Artifact Database"
|
||||
icon_state = "rdcomp"
|
||||
var/list/catalogued_artifacts
|
||||
|
||||
/obj/machinery/computer/artifact_database/New()
|
||||
..()
|
||||
catalogued_artifacts = new/list
|
||||
|
||||
/obj/machinery/computer/artifact_database/Topic(href, href_list)
|
||||
..()
|
||||
if( href_list["close"] )
|
||||
usr << browse(null, "window=artifact_db")
|
||||
usr.machine = null
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/computer/artifact_database/process()
|
||||
..()
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/computer/artifact_database/interact(mob/user)
|
||||
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
|
||||
if (!istype(user, /mob/living/silicon))
|
||||
user.machine = null
|
||||
user << browse(null, "window=artifact_db")
|
||||
return
|
||||
var/t = "<B>Artifact Database</B><BR>"
|
||||
t += "<hr>"
|
||||
for(var/datum/catalogued_artifact/CA in catalogued_artifacts)
|
||||
t += "<B>Artifact ID:</B> [CA.display_id] (determined from unique energy emission signatures)<BR>"
|
||||
t += "<B>Artifact Origin:</B> [CA.origin]<BR>"
|
||||
t += "<B>Activation Trigger:</B> [CA.trigger]<BR>"
|
||||
t += "<B>Artifact Function:</B> [CA.effecttype]<BR>"
|
||||
t += "<B>Artifact Range:</B> [CA.effectmode]<BR><BR>"
|
||||
t += "<hr>"
|
||||
t += "<A href='?src=\ref[src];refresh=1'>Refresh</A> <A href='?src=\ref[src];close=1'>Close</A><BR>"
|
||||
user << browse(t, "window=artifact_db;size=500x800")
|
||||
user.machine = src
|
||||
|
||||
/*
|
||||
/datum/artifact_effect
|
||||
var/origin = null // Used in the randomisation/research of the artifact.
|
||||
var/trigger = "touch" // What activates it?
|
||||
var/triggerX = "none" // Used for more varied triggers
|
||||
var/effecttype = "healing" // What does it do?
|
||||
var/effectmode = "aura" // How does it carry out the effect?
|
||||
var/aurarange = 4 // How far the artifact will extend an aura effect.
|
||||
var/display_id = "" // Artifact ID to display once successfully scanned
|
||||
var/list/created_field
|
||||
*/
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,150 +1,150 @@
|
||||
|
||||
/obj/machinery/artifact_harvester
|
||||
name = "Anomaly Power Collector"
|
||||
icon = 'virology.dmi'
|
||||
icon_state = "incubator" //incubator_on
|
||||
anchored = 1
|
||||
density = 1
|
||||
var/harvesting = 0
|
||||
var/obj/item/weapon/anobattery/inserted_battery
|
||||
var/obj/machinery/artifact/cur_artifact
|
||||
var/obj/machinery/analyser_pad/owned_pad = null
|
||||
|
||||
/obj/machinery/artifact_harvester/New()
|
||||
..()
|
||||
spawn(10)
|
||||
owned_pad = locate() in orange(1, src)
|
||||
|
||||
/obj/machinery/artifact_harvester/attackby(var/obj/I as obj, var/mob/user as mob)
|
||||
if(istype(I,/obj/item/weapon/anobattery))
|
||||
if(!inserted_battery)
|
||||
user << "You insert the battery."
|
||||
user.drop_item()
|
||||
I.loc = src
|
||||
src.inserted_battery = I
|
||||
return
|
||||
else
|
||||
return..()
|
||||
|
||||
/obj/machinery/artifact_harvester/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
use_power(350)
|
||||
|
||||
if(harvesting)
|
||||
use_power(250)
|
||||
inserted_battery.stored_charge += 10
|
||||
if(inserted_battery.stored_charge >= inserted_battery.capacity)
|
||||
inserted_battery.stored_charge = inserted_battery.capacity
|
||||
harvesting = 0
|
||||
cur_artifact.anchored = 0
|
||||
cur_artifact.being_used = 0
|
||||
src.visible_message("<b>[name]</b> states, \"Battery is full.\"")
|
||||
icon_state = "incubator"
|
||||
return
|
||||
|
||||
/obj/machinery/artifact_harvester/interact(var/mob/user as mob)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
user.machine = src
|
||||
var/dat = "<B>Artifact Power Harvester</B><BR>"
|
||||
dat += "<HR><BR>"
|
||||
//
|
||||
if(owned_pad)
|
||||
if(harvesting)
|
||||
dat += "Please wait. Harvesting in progress ([(inserted_battery.stored_charge/inserted_battery.capacity)*100]%).<br>"
|
||||
dat += "<A href='?src=\ref[src];stopharvest=1'>Halt early</A><BR>"
|
||||
else
|
||||
if(inserted_battery)
|
||||
dat += "<b>[inserted_battery.name]</b> inserted, charge level: [inserted_battery.stored_charge]/[inserted_battery.capacity] ([(inserted_battery.stored_charge/inserted_battery.capacity)*100]%)<BR>"
|
||||
dat += "<b>Energy signature ID:</b>[inserted_battery.battery_effect.artifact_id == "" ? "???" : "[inserted_battery.battery_effect.artifact_id]"]<BR>"
|
||||
dat += "<A href='?src=\ref[src];ejectbattery=1'>Eject battery</a><BR>"
|
||||
dat += "<A href='?src=\ref[src];drainbattery=1'>Drain battery of all charge</a><BR>"
|
||||
dat += "<A href='?src=\ref[src];harvest=1'>Begin harvesting</a><BR>"
|
||||
|
||||
else
|
||||
dat += "No battery inserted.<BR>"
|
||||
else
|
||||
dat += "<B><font color=red>Unable to locate analysis pad.</font><BR></b>"
|
||||
//
|
||||
dat += "<HR>"
|
||||
dat += "<A href='?src=\ref[src];refresh=1'>Refresh</A> <A href='?src=\ref[src];close=1'>Close<BR>"
|
||||
user << browse(dat, "window=artharvester;size=450x500")
|
||||
onclose(user, "artharvester")
|
||||
|
||||
/obj/machinery/artifact_harvester/Topic(href, href_list)
|
||||
|
||||
if (href_list["harvest"])
|
||||
//locate artifact on analysis pad
|
||||
cur_artifact = null
|
||||
var/articount = 0
|
||||
var/obj/machinery/artifact/analysed
|
||||
for(var/obj/machinery/artifact/A in get_turf(owned_pad))
|
||||
analysed = A
|
||||
articount++
|
||||
|
||||
var/mundane = 0
|
||||
for(var/obj/O in get_turf(owned_pad))
|
||||
if(!istype(O, /obj/machinery/artifact) && !istype(O, /obj/machinery/analyser_pad))
|
||||
mundane++
|
||||
break
|
||||
for(var/mob/O in get_turf(owned_pad))
|
||||
if(!istype(O, /obj/machinery/artifact))
|
||||
mundane++
|
||||
break
|
||||
|
||||
if(articount == 1 && !mundane)
|
||||
cur_artifact = analysed
|
||||
//check to see if the battery is compatible
|
||||
if(inserted_battery)
|
||||
if(inserted_battery.battery_effect.artifact_id == cur_artifact.my_effect.artifact_id || inserted_battery.stored_charge == 0)
|
||||
harvesting = 1
|
||||
cur_artifact.anchored = 1
|
||||
cur_artifact.being_used = 1
|
||||
icon_state = "incubator_on"
|
||||
var/message = "<b>[src]</b> states, \"Beginning artifact energy harvesting.\""
|
||||
src.visible_message(message, message)
|
||||
//
|
||||
inserted_battery.battery_effect = cur_artifact.my_effect
|
||||
else
|
||||
var/message = "<b>[src]</b> states, \"Cannot harvest. Incompatible energy signatures detected.\""
|
||||
src.visible_message(message, message)
|
||||
else if(cur_artifact)
|
||||
var/message = "<b>[src]</b> states, \"Cannot harvest. No battery inserted.\""
|
||||
src.visible_message(message, message)
|
||||
else if(articount > 1 || mundane)
|
||||
var/message = "<b>[src]</b> states, \"Cannot harvest. Error isolating energy signature.\""
|
||||
src.visible_message(message, message)
|
||||
else if(!articount)
|
||||
var/message = "<b>[src]</b> states, \"Cannot harvest. No noteworthy energy signature isolated.\""
|
||||
src.visible_message(message, message)
|
||||
else if (cur_artifact.being_used)
|
||||
var/message = "<b>[src]</b> states, \"Cannot harvest. Too much interferance from energy scan.\""
|
||||
src.visible_message(message, message)
|
||||
|
||||
if (href_list["stopharvest"])
|
||||
if(harvesting)
|
||||
harvesting = 0
|
||||
cur_artifact.anchored = 0
|
||||
cur_artifact.being_used = 0
|
||||
src.visible_message("<b>[name]</b> states, \"Harvesting interrupted.\"")
|
||||
icon_state = "incubator"
|
||||
|
||||
|
||||
if (href_list["ejectbattery"])
|
||||
src.inserted_battery.loc = src.loc
|
||||
src.inserted_battery = null
|
||||
|
||||
if (href_list["drainbattery"])
|
||||
use_power(100)
|
||||
src.inserted_battery.battery_effect.artifact_id = ""
|
||||
src.inserted_battery.stored_charge = 0
|
||||
var/message = "<b>[src]</b> states, \"Battery drained of all charge.\""
|
||||
src.visible_message(message, message)
|
||||
|
||||
if(href_list["close"])
|
||||
usr << browse(null, "window=artharvester")
|
||||
usr.machine = null
|
||||
|
||||
src.updateDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/artifact_harvester
|
||||
name = "Anomaly Power Collector"
|
||||
icon = 'virology.dmi'
|
||||
icon_state = "incubator" //incubator_on
|
||||
anchored = 1
|
||||
density = 1
|
||||
var/harvesting = 0
|
||||
var/obj/item/weapon/anobattery/inserted_battery
|
||||
var/obj/machinery/artifact/cur_artifact
|
||||
var/obj/machinery/analyser_pad/owned_pad = null
|
||||
|
||||
/obj/machinery/artifact_harvester/New()
|
||||
..()
|
||||
spawn(10)
|
||||
owned_pad = locate() in orange(1, src)
|
||||
|
||||
/obj/machinery/artifact_harvester/attackby(var/obj/I as obj, var/mob/user as mob)
|
||||
if(istype(I,/obj/item/weapon/anobattery))
|
||||
if(!inserted_battery)
|
||||
user << "You insert the battery."
|
||||
user.drop_item()
|
||||
I.loc = src
|
||||
src.inserted_battery = I
|
||||
return
|
||||
else
|
||||
return..()
|
||||
|
||||
/obj/machinery/artifact_harvester/process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
use_power(350)
|
||||
|
||||
if(harvesting)
|
||||
use_power(250)
|
||||
inserted_battery.stored_charge += 10
|
||||
if(inserted_battery.stored_charge >= inserted_battery.capacity)
|
||||
inserted_battery.stored_charge = inserted_battery.capacity
|
||||
harvesting = 0
|
||||
cur_artifact.anchored = 0
|
||||
cur_artifact.being_used = 0
|
||||
src.visible_message("<b>[name]</b> states, \"Battery is full.\"")
|
||||
icon_state = "incubator"
|
||||
return
|
||||
|
||||
/obj/machinery/artifact_harvester/interact(var/mob/user as mob)
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
user.machine = src
|
||||
var/dat = "<B>Artifact Power Harvester</B><BR>"
|
||||
dat += "<HR><BR>"
|
||||
//
|
||||
if(owned_pad)
|
||||
if(harvesting)
|
||||
dat += "Please wait. Harvesting in progress ([(inserted_battery.stored_charge/inserted_battery.capacity)*100]%).<br>"
|
||||
dat += "<A href='?src=\ref[src];stopharvest=1'>Halt early</A><BR>"
|
||||
else
|
||||
if(inserted_battery)
|
||||
dat += "<b>[inserted_battery.name]</b> inserted, charge level: [inserted_battery.stored_charge]/[inserted_battery.capacity] ([(inserted_battery.stored_charge/inserted_battery.capacity)*100]%)<BR>"
|
||||
dat += "<b>Energy signature ID:</b>[inserted_battery.battery_effect.artifact_id == "" ? "???" : "[inserted_battery.battery_effect.artifact_id]"]<BR>"
|
||||
dat += "<A href='?src=\ref[src];ejectbattery=1'>Eject battery</a><BR>"
|
||||
dat += "<A href='?src=\ref[src];drainbattery=1'>Drain battery of all charge</a><BR>"
|
||||
dat += "<A href='?src=\ref[src];harvest=1'>Begin harvesting</a><BR>"
|
||||
|
||||
else
|
||||
dat += "No battery inserted.<BR>"
|
||||
else
|
||||
dat += "<B><font color=red>Unable to locate analysis pad.</font><BR></b>"
|
||||
//
|
||||
dat += "<HR>"
|
||||
dat += "<A href='?src=\ref[src];refresh=1'>Refresh</A> <A href='?src=\ref[src];close=1'>Close<BR>"
|
||||
user << browse(dat, "window=artharvester;size=450x500")
|
||||
onclose(user, "artharvester")
|
||||
|
||||
/obj/machinery/artifact_harvester/Topic(href, href_list)
|
||||
|
||||
if (href_list["harvest"])
|
||||
//locate artifact on analysis pad
|
||||
cur_artifact = null
|
||||
var/articount = 0
|
||||
var/obj/machinery/artifact/analysed
|
||||
for(var/obj/machinery/artifact/A in get_turf(owned_pad))
|
||||
analysed = A
|
||||
articount++
|
||||
|
||||
var/mundane = 0
|
||||
for(var/obj/O in get_turf(owned_pad))
|
||||
if(!istype(O, /obj/machinery/artifact) && !istype(O, /obj/machinery/analyser_pad))
|
||||
mundane++
|
||||
break
|
||||
for(var/mob/O in get_turf(owned_pad))
|
||||
if(!istype(O, /obj/machinery/artifact))
|
||||
mundane++
|
||||
break
|
||||
|
||||
if(articount == 1 && !mundane)
|
||||
cur_artifact = analysed
|
||||
//check to see if the battery is compatible
|
||||
if(inserted_battery)
|
||||
if(inserted_battery.battery_effect.artifact_id == cur_artifact.my_effect.artifact_id || inserted_battery.stored_charge == 0)
|
||||
harvesting = 1
|
||||
cur_artifact.anchored = 1
|
||||
cur_artifact.being_used = 1
|
||||
icon_state = "incubator_on"
|
||||
var/message = "<b>[src]</b> states, \"Beginning artifact energy harvesting.\""
|
||||
src.visible_message(message, message)
|
||||
//
|
||||
inserted_battery.battery_effect = cur_artifact.my_effect
|
||||
else
|
||||
var/message = "<b>[src]</b> states, \"Cannot harvest. Incompatible energy signatures detected.\""
|
||||
src.visible_message(message, message)
|
||||
else if(cur_artifact)
|
||||
var/message = "<b>[src]</b> states, \"Cannot harvest. No battery inserted.\""
|
||||
src.visible_message(message, message)
|
||||
else if(articount > 1 || mundane)
|
||||
var/message = "<b>[src]</b> states, \"Cannot harvest. Error isolating energy signature.\""
|
||||
src.visible_message(message, message)
|
||||
else if(!articount)
|
||||
var/message = "<b>[src]</b> states, \"Cannot harvest. No noteworthy energy signature isolated.\""
|
||||
src.visible_message(message, message)
|
||||
else if (cur_artifact.being_used)
|
||||
var/message = "<b>[src]</b> states, \"Cannot harvest. Too much interferance from energy scan.\""
|
||||
src.visible_message(message, message)
|
||||
|
||||
if (href_list["stopharvest"])
|
||||
if(harvesting)
|
||||
harvesting = 0
|
||||
cur_artifact.anchored = 0
|
||||
cur_artifact.being_used = 0
|
||||
src.visible_message("<b>[name]</b> states, \"Harvesting interrupted.\"")
|
||||
icon_state = "incubator"
|
||||
|
||||
|
||||
if (href_list["ejectbattery"])
|
||||
src.inserted_battery.loc = src.loc
|
||||
src.inserted_battery = null
|
||||
|
||||
if (href_list["drainbattery"])
|
||||
use_power(100)
|
||||
src.inserted_battery.battery_effect.artifact_id = ""
|
||||
src.inserted_battery.stored_charge = 0
|
||||
var/message = "<b>[src]</b> states, \"Battery drained of all charge.\""
|
||||
src.visible_message(message, message)
|
||||
|
||||
if(href_list["close"])
|
||||
usr << browse(null, "window=artharvester")
|
||||
usr.machine = null
|
||||
|
||||
src.updateDialog()
|
||||
return
|
||||
@@ -1,144 +1,144 @@
|
||||
|
||||
/obj/item/weapon/anobattery
|
||||
name = "Anomaly power battery"
|
||||
icon = 'xenoarchaeology.dmi'
|
||||
icon_state = "anobattery0"
|
||||
var/datum/artifact_effect/battery_effect
|
||||
var/capacity = 200
|
||||
var/stored_charge = 0
|
||||
|
||||
/obj/item/weapon/anobattery/New()
|
||||
battery_effect = new()
|
||||
|
||||
/obj/item/weapon/anobattery/proc/UpdateSprite()
|
||||
var/p = (stored_charge/capacity)*100
|
||||
icon_state = "anobattery[round(p,25)]"
|
||||
|
||||
/obj/item/weapon/anodevice
|
||||
name = "Anomaly power utilizer"
|
||||
icon = 'xenoarchaeology.dmi'
|
||||
icon_state = "anodev"
|
||||
var/cooldown = 0
|
||||
var/activated = 0
|
||||
var/time = 50
|
||||
var/obj/item/weapon/anobattery/inserted_battery
|
||||
|
||||
/obj/item/weapon/anodevice/New()
|
||||
spawn(10)
|
||||
pulse()
|
||||
|
||||
/obj/item/weapon/anodevice/proc/UpdateSprite()
|
||||
if(!inserted_battery)
|
||||
icon_state = "anodev"
|
||||
return
|
||||
var/p = (inserted_battery.stored_charge/inserted_battery.capacity)*100
|
||||
var/s = round(p,25)
|
||||
icon_state = "anodev[s]"
|
||||
|
||||
/obj/item/weapon/anodevice/interact(var/mob/user)
|
||||
user.machine = src
|
||||
var/dat = "<b>Anomalous Materials Energy Utiliser</b><br>"
|
||||
if(activated)
|
||||
dat += "Device active, stand by.<BR>"
|
||||
else if(cooldown)
|
||||
dat += "Cooldown in progress, please wait.<BR>"
|
||||
else
|
||||
if(!inserted_battery)
|
||||
dat += "Please insert battery<BR>"
|
||||
else
|
||||
dat += "[inserted_battery] inserted, anomaly ID: [inserted_battery.battery_effect.artifact_id == "" ? "???" : "[inserted_battery.battery_effect.artifact_id]"]<BR>"
|
||||
dat += "<b>Total Power:</b> [inserted_battery.stored_charge]/[inserted_battery.capacity]<BR><BR>"
|
||||
dat += "<b>Timed activation:</b> <A href='?src=\ref[src];neg_changetime_max=-100'>--</a> <A href='?src=\ref[src];neg_changetime=-10'>-</a> [time >= 1000 ? "[time/10]" : time >= 100 ? " [time/10]" : " [time/10]" ] <A href='?src=\ref[src];changetime=10'>+</a> <A href='?src=\ref[src];changetime_max=100'>++</a><BR>"
|
||||
if(cooldown && !activated)
|
||||
dat += "<font color=red>Cooldown in progress.</font><BR>"
|
||||
else if(activated)
|
||||
dat += "<A href='?src=\ref[src];stoptimer=1'>Stop timer</a><BR>"
|
||||
else
|
||||
dat += "<A href='?src=\ref[src];starttimer=1'>Start timer</a><BR>"
|
||||
dat += "<A href='?src=\ref[src];ejectbattery=1'>Eject battery</a><BR>"
|
||||
dat += "<A href='?src=\ref[src];refresh=1'>Refresh</a><BR>"
|
||||
dat += "<A href='?src=\ref[src];close=1'>Close</a><BR>"
|
||||
|
||||
user << browse(dat, "window=anodevice;size=400x500")
|
||||
onclose(user, "anodevice")
|
||||
return
|
||||
|
||||
/obj/item/weapon/anodevice/attackby(var/obj/I as obj, var/mob/user as mob)
|
||||
if(istype(I, /obj/item/weapon/anobattery))
|
||||
if(!inserted_battery)
|
||||
user << "\blue You insert the battery."
|
||||
user.drop_item()
|
||||
I.loc = src
|
||||
inserted_battery = I
|
||||
UpdateSprite()
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/anodevice/attack_self(var/mob/user as mob)
|
||||
return src.interact(user)
|
||||
|
||||
/obj/item/weapon/anodevice/proc/pulse()
|
||||
if(activated)
|
||||
if(time <= 0 || !inserted_battery)
|
||||
time = 0
|
||||
activated = 0
|
||||
var/turf/T = get_turf(src)
|
||||
T.visible_message("\icon[src]\blue The utiliser device buzzes.", "\icon[src]\blue You hear something buzz.")
|
||||
else
|
||||
inserted_battery.battery_effect.DoEffect(src)
|
||||
time -= 10
|
||||
inserted_battery.stored_charge -= 10 + rand(-1,1)
|
||||
cooldown += 10
|
||||
else if(cooldown > 0)
|
||||
cooldown -= 10
|
||||
if(cooldown <= 0)
|
||||
cooldown = 0
|
||||
var/turf/T = get_turf(src)
|
||||
T.visible_message("\icon[src]\blue The utiliser device chimes.", "\icon[src]\blue You hear something chime.")
|
||||
|
||||
spawn(10)
|
||||
pulse()
|
||||
|
||||
/obj/item/weapon/anodevice/Topic(href, href_list)
|
||||
|
||||
if(href_list["neg_changetime_max"])
|
||||
time += -100
|
||||
if(time > inserted_battery.capacity)
|
||||
time = inserted_battery.capacity
|
||||
else if (time < 0)
|
||||
time = 0
|
||||
if(href_list["neg_changetime"])
|
||||
time += -10
|
||||
if(time > inserted_battery.capacity)
|
||||
time = inserted_battery.capacity
|
||||
else if (time < 0)
|
||||
time = 0
|
||||
if(href_list["changetime"])
|
||||
time += 10
|
||||
if(time > inserted_battery.capacity)
|
||||
time = inserted_battery.capacity
|
||||
else if (time < 0)
|
||||
time = 0
|
||||
if(href_list["changetime_max"])
|
||||
time += 100
|
||||
if(time > inserted_battery.capacity)
|
||||
time = inserted_battery.capacity
|
||||
else if (time < 0)
|
||||
time = 0
|
||||
|
||||
if(href_list["stoptimer"])
|
||||
activated = 0
|
||||
|
||||
if(href_list["starttimer"])
|
||||
activated = 1
|
||||
|
||||
if(href_list["ejectbattery"])
|
||||
inserted_battery.loc = get_turf(src)
|
||||
inserted_battery = null
|
||||
UpdateSprite()
|
||||
|
||||
if(href_list["close"])
|
||||
usr << browse(null, "window=anodevice")
|
||||
usr.machine = null
|
||||
else if(usr)
|
||||
src.interact(usr)
|
||||
|
||||
/obj/item/weapon/anobattery
|
||||
name = "Anomaly power battery"
|
||||
icon = 'xenoarchaeology.dmi'
|
||||
icon_state = "anobattery0"
|
||||
var/datum/artifact_effect/battery_effect
|
||||
var/capacity = 200
|
||||
var/stored_charge = 0
|
||||
|
||||
/obj/item/weapon/anobattery/New()
|
||||
battery_effect = new()
|
||||
|
||||
/obj/item/weapon/anobattery/proc/UpdateSprite()
|
||||
var/p = (stored_charge/capacity)*100
|
||||
icon_state = "anobattery[round(p,25)]"
|
||||
|
||||
/obj/item/weapon/anodevice
|
||||
name = "Anomaly power utilizer"
|
||||
icon = 'xenoarchaeology.dmi'
|
||||
icon_state = "anodev"
|
||||
var/cooldown = 0
|
||||
var/activated = 0
|
||||
var/time = 50
|
||||
var/obj/item/weapon/anobattery/inserted_battery
|
||||
|
||||
/obj/item/weapon/anodevice/New()
|
||||
spawn(10)
|
||||
pulse()
|
||||
|
||||
/obj/item/weapon/anodevice/proc/UpdateSprite()
|
||||
if(!inserted_battery)
|
||||
icon_state = "anodev"
|
||||
return
|
||||
var/p = (inserted_battery.stored_charge/inserted_battery.capacity)*100
|
||||
var/s = round(p,25)
|
||||
icon_state = "anodev[s]"
|
||||
|
||||
/obj/item/weapon/anodevice/interact(var/mob/user)
|
||||
user.machine = src
|
||||
var/dat = "<b>Anomalous Materials Energy Utiliser</b><br>"
|
||||
if(activated)
|
||||
dat += "Device active, stand by.<BR>"
|
||||
else if(cooldown)
|
||||
dat += "Cooldown in progress, please wait.<BR>"
|
||||
else
|
||||
if(!inserted_battery)
|
||||
dat += "Please insert battery<BR>"
|
||||
else
|
||||
dat += "[inserted_battery] inserted, anomaly ID: [inserted_battery.battery_effect.artifact_id == "" ? "???" : "[inserted_battery.battery_effect.artifact_id]"]<BR>"
|
||||
dat += "<b>Total Power:</b> [inserted_battery.stored_charge]/[inserted_battery.capacity]<BR><BR>"
|
||||
dat += "<b>Timed activation:</b> <A href='?src=\ref[src];neg_changetime_max=-100'>--</a> <A href='?src=\ref[src];neg_changetime=-10'>-</a> [time >= 1000 ? "[time/10]" : time >= 100 ? " [time/10]" : " [time/10]" ] <A href='?src=\ref[src];changetime=10'>+</a> <A href='?src=\ref[src];changetime_max=100'>++</a><BR>"
|
||||
if(cooldown && !activated)
|
||||
dat += "<font color=red>Cooldown in progress.</font><BR>"
|
||||
else if(activated)
|
||||
dat += "<A href='?src=\ref[src];stoptimer=1'>Stop timer</a><BR>"
|
||||
else
|
||||
dat += "<A href='?src=\ref[src];starttimer=1'>Start timer</a><BR>"
|
||||
dat += "<A href='?src=\ref[src];ejectbattery=1'>Eject battery</a><BR>"
|
||||
dat += "<A href='?src=\ref[src];refresh=1'>Refresh</a><BR>"
|
||||
dat += "<A href='?src=\ref[src];close=1'>Close</a><BR>"
|
||||
|
||||
user << browse(dat, "window=anodevice;size=400x500")
|
||||
onclose(user, "anodevice")
|
||||
return
|
||||
|
||||
/obj/item/weapon/anodevice/attackby(var/obj/I as obj, var/mob/user as mob)
|
||||
if(istype(I, /obj/item/weapon/anobattery))
|
||||
if(!inserted_battery)
|
||||
user << "\blue You insert the battery."
|
||||
user.drop_item()
|
||||
I.loc = src
|
||||
inserted_battery = I
|
||||
UpdateSprite()
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/anodevice/attack_self(var/mob/user as mob)
|
||||
return src.interact(user)
|
||||
|
||||
/obj/item/weapon/anodevice/proc/pulse()
|
||||
if(activated)
|
||||
if(time <= 0 || !inserted_battery)
|
||||
time = 0
|
||||
activated = 0
|
||||
var/turf/T = get_turf(src)
|
||||
T.visible_message("\icon[src]\blue The utiliser device buzzes.", "\icon[src]\blue You hear something buzz.")
|
||||
else
|
||||
inserted_battery.battery_effect.DoEffect(src)
|
||||
time -= 10
|
||||
inserted_battery.stored_charge -= 10 + rand(-1,1)
|
||||
cooldown += 10
|
||||
else if(cooldown > 0)
|
||||
cooldown -= 10
|
||||
if(cooldown <= 0)
|
||||
cooldown = 0
|
||||
var/turf/T = get_turf(src)
|
||||
T.visible_message("\icon[src]\blue The utiliser device chimes.", "\icon[src]\blue You hear something chime.")
|
||||
|
||||
spawn(10)
|
||||
pulse()
|
||||
|
||||
/obj/item/weapon/anodevice/Topic(href, href_list)
|
||||
|
||||
if(href_list["neg_changetime_max"])
|
||||
time += -100
|
||||
if(time > inserted_battery.capacity)
|
||||
time = inserted_battery.capacity
|
||||
else if (time < 0)
|
||||
time = 0
|
||||
if(href_list["neg_changetime"])
|
||||
time += -10
|
||||
if(time > inserted_battery.capacity)
|
||||
time = inserted_battery.capacity
|
||||
else if (time < 0)
|
||||
time = 0
|
||||
if(href_list["changetime"])
|
||||
time += 10
|
||||
if(time > inserted_battery.capacity)
|
||||
time = inserted_battery.capacity
|
||||
else if (time < 0)
|
||||
time = 0
|
||||
if(href_list["changetime_max"])
|
||||
time += 100
|
||||
if(time > inserted_battery.capacity)
|
||||
time = inserted_battery.capacity
|
||||
else if (time < 0)
|
||||
time = 0
|
||||
|
||||
if(href_list["stoptimer"])
|
||||
activated = 0
|
||||
|
||||
if(href_list["starttimer"])
|
||||
activated = 1
|
||||
|
||||
if(href_list["ejectbattery"])
|
||||
inserted_battery.loc = get_turf(src)
|
||||
inserted_battery = null
|
||||
UpdateSprite()
|
||||
|
||||
if(href_list["close"])
|
||||
usr << browse(null, "window=anodevice")
|
||||
usr.machine = null
|
||||
else if(usr)
|
||||
src.interact(usr)
|
||||
Reference in New Issue
Block a user