Lay groundwork for megafauna, and add Ashdragon.

Includes a refactor for gun turrets (merged into portable turrets), hostile simple_animal behaviour, spells (sounds have been added) and poi_list items.
This commit is contained in:
Markolie
2016-10-23 23:15:57 +02:00
parent f110b9e6a5
commit 2e711d1337
122 changed files with 1650 additions and 776 deletions
+6
View File
@@ -36,6 +36,8 @@
var/list/original_atom
var/allow_spin = 1 //Set this to 1 for a _target_ that is being thrown at; if an atom has this set to 1 then atoms thrown AT it will not spin; currently used for the singularity. -Fox
var/admin_spawned = 0 //was this spawned by an admin? used for stat tracking stuff.
/atom/proc/onCentcom()
var/turf/T = get_turf(src)
@@ -455,3 +457,7 @@
/atom/proc/speech_bubble(var/bubble_state = "",var/bubble_loc = src, var/list/bubble_recipients = list())
return
/atom/on_varedit(modified_var)
if(!Debug2)
admin_spawned = TRUE
+4
View File
@@ -212,6 +212,10 @@
if(isobj(A))
if(A.density && !A.throwpass) // **TODO: Better behaviour for windows which are dense, but shouldn't always stop movement
src.throw_impact(A,speed)
/atom/movable/proc/throw_at_fast(atom/target, range, speed, thrower, no_spin)
set waitfor = 0
throw_at(target, range, speed, thrower, no_spin)
/atom/movable/proc/throw_at(atom/target, range, speed, thrower, no_spin)
if(!target || !src || (flags & NODROP))
+2
View File
@@ -14,6 +14,7 @@
/obj/effect/blob/core/New(loc, var/h = 200, var/client/new_overmind = null, var/new_rate = 2, offspring)
blob_cores += src
processing_objects.Add(src)
poi_list |= src
adjustcolors(color) //so it atleast appears
if(!overmind)
create_overmind(new_overmind)
@@ -41,6 +42,7 @@
overmind.blob_core = null
overmind = null
processing_objects.Remove(src)
poi_list.Remove(src)
return ..()
/obj/effect/blob/core/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
+2
View File
@@ -73,9 +73,11 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology",
for(var/mob/living/silicon/ai/AI in player_list)
AI.client.images += blood
cult_viewpoints += src
poi_list |= src
/obj/effect/rune/Destroy()
cult_viewpoints -= src
poi_list.Remove(src)
return ..()
/obj/effect/rune/examine(mob/user)
@@ -6,7 +6,7 @@
icon_state = "swarmer_unactivated"
/obj/item/unactivated_swarmer/New()
notify_ghosts("An unactivated swarmer has been created in [get_area(src)]!", enter_link = "<a href=?src=[UID()];ghostjoin=1>(Click to enter)</a>", source = src, attack_not_jump = 1)
notify_ghosts("An unactivated swarmer has been created in [get_area(src)]!", enter_link = "<a href=?src=[UID()];ghostjoin=1>(Click to enter)</a>", source = src, action = NOTIFY_ATTACK)
..()
/obj/item/unactivated_swarmer/Topic(href, href_list)
@@ -63,7 +63,7 @@
mob_size = MOB_SIZE_TINY
ventcrawler = 2
ranged = 1
ranged_cooldown_cap = 1
ranged_cooldown_time = 20
universal_speak = 0
universal_understand = 0
projectilesound = 'sound/weapons/taser2.ogg'
@@ -496,7 +496,7 @@
melee_damage_upper = 10
damage_transfer = 0.9
projectiletype = /obj/item/projectile/guardian
ranged_cooldown_cap = 1
ranged_cooldown_time = 1
projectilesound = 'sound/effects/hit_on_shattered_glass.ogg'
ranged = 1
rapid = 1
+1 -1
View File
@@ -307,7 +307,7 @@ proc/issyndicate(mob/living/M as mob)
/datum/game_mode/nuclear/declare_completion()
var/disk_rescued = 1
for(var/obj/item/weapon/disk/nuclear/D in world)
for(var/obj/item/weapon/disk/nuclear/D in poi_list)
if(!D.onCentcom())
disk_rescued = 0
break
@@ -32,10 +32,12 @@ var/bomb_set
r_code = "[rand(10000, 99999.0)]"//Creates a random code upon object spawn.
wires = new/datum/wires/nuclearbomb(src)
previous_level = get_security_level()
poi_list |= src
/obj/machinery/nuclearbomb/Destroy()
qdel(wires)
wires = null
poi_list.Remove(src)
return ..()
/obj/machinery/nuclearbomb/process()
@@ -88,6 +88,8 @@
new /obj/item/weapon/gun/projectile/revolver/grenadelauncher(get_turf(H))
if("medibeam")
new /obj/item/weapon/gun/medbeam(get_turf(H))
playsound(get_turf(H),'sound/magic/Summon_guns.ogg', 50, 1)
else
switch(randomizemagic)
if("fireball")
@@ -155,3 +157,5 @@
if("necromantic")
new /obj/item/device/necromantic_stone(get_turf(H))
to_chat(H, "<span class='notice'>You suddenly feel lucky.</span>")
playsound(get_turf(H),'sound/magic/Summon_Magic.ogg', 50, 1)
+6
View File
@@ -854,3 +854,9 @@
spellname = "disintegrate"
icon_state ="bookfireball"
desc = "This book feels like it will rip stuff apart."
/obj/item/weapon/spellbook/oneuse/sacredflame
spell = /obj/effect/proc_holder/spell/targeted/sacred_flame
spellname = "sacred flame"
icon_state ="booksacredflame"
desc = "Become one with the flames that burn within... and invite others to do so as well."
+110 -21
View File
@@ -56,6 +56,12 @@
var/screen = 0 // Screen 0: main control, screen 1: access levels
var/one_access = 0 // Determines if access control is set to req_one_access or req_access
var/faction = "neutral"
var/emp_vulnerable = 1 // Can be empd
var/scan_range = 7
var/always_up = 0 //Will stay active
var/has_cover = 1 //Hides the cover
/obj/machinery/porta_turret/centcom
enabled = 0
@@ -460,7 +466,7 @@ var/list/turret_icons
take_damage(Proj.damage)
/obj/machinery/porta_turret/emp_act(severity)
if(enabled)
if(enabled && emp_vulnerable)
//if the turret is on, the EMP no matter how severe disables the turret for a while
//and scrambles its settings, with a slight chance of having an emag effect
check_arrest = prob(50)
@@ -502,35 +508,43 @@ var/list/turret_icons
set background = BACKGROUND_ENABLED
if(stat & (NOPOWER|BROKEN))
//if the turret has no power or is broken, make the turret pop down if it hasn't already
popDown()
if(!always_up)
//if the turret has no power or is broken, make the turret pop down if it hasn't already
popDown()
return
if(!enabled)
//if the turret is off, make it pop down
popDown()
if(!always_up)
//if the turret is off, make it pop down
popDown()
return
var/list/targets = list() //list of primary targets
var/list/secondarytargets = list() //targets that are least important
for(var/obj/mecha/ME in view(7,src))
for(var/obj/mecha/ME in view(scan_range,src))
assess_and_assign(ME.occupant, targets, secondarytargets)
for(var/obj/spacepod/SP in view(7,src))
for(var/obj/spacepod/SP in view(scan_range,src))
assess_and_assign(SP.pilot, targets, secondarytargets)
for(var/obj/vehicle/T in view(7,src))
for(var/obj/vehicle/T in view(scan_range,src))
assess_and_assign(T.buckled_mob, targets, secondarytargets)
for(var/mob/living/C in view(7,src)) //loops through all living lifeforms in view
for(var/mob/living/C in view(scan_range,src)) //loops through all living lifeforms in view
assess_and_assign(C, targets, secondarytargets)
if(!tryToShootAt(targets))
if(!tryToShootAt(secondarytargets)) // if no valid targets, go for secondary targets
spawn()
popDown() // no valid targets, close the cover
if(!always_up)
spawn()
popDown() // no valid targets, close the cover
/obj/machinery/porta_turret/proc/in_faction(mob/living/target)
if(!(faction in target.faction))
return 0
return 1
/obj/machinery/porta_turret/proc/assess_and_assign(var/mob/living/L, var/list/targets, var/list/secondarytargets)
switch(assess_living(L))
if(TURRET_PRIORITY_TARGET)
@@ -557,11 +571,14 @@ var/list/turret_icons
if(L.stat && !emagged) //if the perp is dead/dying, no need to bother really
return TURRET_NOT_TARGET //move onto next potential victim!
if(get_dist(src, L) > 7) //if it's too far away, why bother?
if(get_dist(src, L) > scan_range) //if it's too far away, why bother?
return TURRET_NOT_TARGET
if(emagged) // If emagged not even the dead get a rest
return L.stat ? TURRET_SECONDARY_TARGET : TURRET_PRIORITY_TARGET
if(in_faction(L))
return TURRET_NOT_TARGET
if(lethal && locate(/mob/living/silicon/ai) in get_turf(L)) //don't accidentally kill the AI!
return TURRET_NOT_TARGET
@@ -648,8 +665,8 @@ var/list/turret_icons
return ..()
/obj/machinery/porta_turret/proc/set_raised_raising(var/raised, var/raising)
src.raised = raised
src.raising = raising
raised = raised
raising = raising
density = raised || raising
/obj/machinery/porta_turret/proc/target(var/mob/living/target)
@@ -657,8 +674,9 @@ var/list/turret_icons
return
if(target)
last_target = target
spawn()
popUp() //pop the turret up if it's not already up.
if(has_cover)
spawn()
popUp() //pop the turret up if it's not already up.
dir = get_dir(src, target) //even if you can't shoot, follow the target
spawn()
shootAt(target)
@@ -666,7 +684,7 @@ var/list/turret_icons
return
/obj/machinery/porta_turret/proc/shootAt(var/mob/living/target)
if(!raised) //the turret has to be raised in order to fire - makes sense, right?
if(!raised && has_cover) //the turret has to be raised in order to fire - makes sense, right?
return
//any emagged turrets will shoot extremely fast! This not only is deadly, but drains a lot power!
if(!emagged) //if it hasn't been emagged, it has to obey a cooldown rate
@@ -718,9 +736,9 @@ var/list/turret_icons
/obj/machinery/porta_turret/proc/setState(var/datum/turret_checks/TC)
if(controllock)
return
src.enabled = TC.enabled
src.lethal = TC.lethal
src.iconholder = TC.lethal
enabled = TC.enabled
lethal = TC.lethal
iconholder = TC.lethal
check_synth = TC.check_synth
check_access = TC.check_access
@@ -730,7 +748,7 @@ var/list/turret_icons
check_anomalies = TC.check_anomalies
ailock = TC.ailock
src.power_change()
power_change()
/*
Portable turret constructions
@@ -943,3 +961,74 @@ var/list/turret_icons
/atom/movable/porta_turret_cover
icon = 'icons/obj/turrets.dmi'
// Syndicate turrets
/obj/machinery/porta_turret/syndicate
installation = null
always_up = 1
use_power = 0
has_cover = 0
scan_range = 9
projectile = /obj/item/projectile/bullet
eprojectile = /obj/item/projectile/bullet
shot_sound = 'sound/weapons/Gunshot.ogg'
eshot_sound = 'sound/weapons/Gunshot.ogg'
icon_state = "syndieturret0"
var/icon_state_initial = "syndieturret0"
var/icon_state_active = "syndieturret1"
var/icon_state_destroyed = "syndieturret2"
faction = "syndicate"
emp_vulnerable = 0
raised = 1
/obj/machinery/porta_turret/syndicate/New()
..()
if(req_one_access && req_one_access.len)
req_one_access.Cut()
req_access = list(access_syndicate)
one_access = 0
/obj/machinery/porta_turret/syndicate/update_icon()
if(stat & BROKEN)
icon_state = icon_state_destroyed
else if(enabled)
icon_state = icon_state_active
else
icon_state = icon_state_initial
/obj/machinery/porta_turret/syndicate/setup()
return
/obj/machinery/porta_turret/syndicate/assess_perp(mob/living/carbon/human/perp)
return 10 //Syndicate turrets shoot everything not in their faction
/obj/machinery/porta_turret/syndicate/pod
health = 40
projectile = /obj/item/projectile/bullet/weakbullet3
eprojectile = /obj/item/projectile/bullet/weakbullet3
/obj/machinery/porta_turret/syndicate/interior
name = "machine gun turret (.45)"
desc = "Syndicate interior defense turret chambered for .45 rounds. Designed to down intruders without damaging the hull."
projectile = /obj/item/projectile/bullet/midbullet
eprojectile = /obj/item/projectile/bullet/midbullet
/obj/machinery/porta_turret/syndicate/exterior
name = "machine gun turret (7.62)"
desc = "Syndicate exterior defense turret chambered for 7.62 rounds. Designed to down intruders with heavy calliber bullets."
projectile = /obj/item/projectile/bullet
eprojectile = /obj/item/projectile/bullet/midbullet
/obj/machinery/porta_turret/syndicate/grenade
name = "mounted grenade launcher (40mm)"
desc = "Syndicate 40mm grenade launcher defense turret. If you've had this much time to look at it, you're probably already dead."
projectile = /obj/item/projectile/bullet/a40mm
eprojectile = /obj/item/projectile/bullet/midbullet
/obj/machinery/porta_turret/syndicate/assault_pod
name = "machine gun turret (4.6x30mm)"
desc = "Syndicate exterior defense turret chambered for 4.6x30mm rounds. Designed to be fitted to assault pods, it uses low calliber bullets to save space."
health = 100
projectile = /obj/item/projectile/bullet/weakbullet3
eprojectile = /obj/item/projectile/bullet/midbullet
+1
View File
@@ -257,6 +257,7 @@
var/obj/machinery/syndicatebomb/B = src.loc
for(var/i = 0; i < amt_summon; i++)
var/atom/movable/X = new summon_path
X.admin_spawned = TRUE
X.loc = get_turf(src)
if(prob(50))
for(var/j = 1, j <= rand(1, 3), j++)
-580
View File
@@ -1,580 +0,0 @@
/area/turret_protected
name = "Turret Protected Area"
var/list/turretTargets = list()
/area/turret_protected/proc/subjectDied(target)
if( isliving(target) )
if( !issilicon(target) )
var/mob/living/L = target
if( L.stat )
if( L in turretTargets )
src.Exited(L)
/area/turret_protected/Entered(O)
..()
if( iscarbon(O) )
turretTargets |= O
else if( istype(O, /obj/mecha) )
var/obj/mecha/Mech = O
if( Mech.occupant )
turretTargets |= Mech
else if( istype(O, /obj/spacepod) )
var/obj/spacepod/Pod = O
if( Pod.pilot )
turretTargets |= Pod
else if(istype(O,/mob/living/simple_animal))
turretTargets |= O
return 1
/area/turret_protected/Exited(O)
if( ismob(O) && !issilicon(O) )
turretTargets -= O
else if( istype(O, /obj/mecha) )
turretTargets -= O
else if( istype(O, /obj/spacepod) )
turretTargets -= O
..()
return 1
/obj/machinery/turret
name = "turret"
icon = 'icons/obj/turrets.dmi'
icon_state = "grey_target_prism"
var/raised = 0
var/enabled = 1
anchored = 1
layer = 3
invisibility = INVISIBILITY_LEVEL_TWO
density = 1
var/lasers = 0
var/lasertype = 1
// 1 = lasers
// 2 = cannons
// 3 = pulse
// 4 = change (HONK)
// 5 = bluetag
// 6 = redtag
var/health = 80
var/obj/machinery/turretcover/cover = null
var/popping = 0
var/wasvalid = 0
var/lastfired = 0
var/shot_delay = 30 //3 seconds between shots
var/datum/effect/system/spark_spread/spark_system
use_power = 1
idle_power_usage = 50
active_power_usage = 300
// var/list/targets
var/atom/movable/cur_target
var/targeting_active = 0
var/area/turret_protected/protected_area
/obj/machinery/turret/New()
spark_system = new /datum/effect/system/spark_spread
spark_system.set_up(5, 0, src)
spark_system.attach(src)
// targets = new
..()
return
/obj/machinery/turretcover
name = "pop-up turret cover"
icon = 'icons/obj/turrets.dmi'
icon_state = "turretCover"
anchored = 1
layer = 3.5
density = 0
var/obj/machinery/turret/host = null
/obj/machinery/turret/proc/isPopping()
return (popping!=0)
/obj/machinery/turret/power_change()
if(stat & BROKEN)
icon_state = "grey_target_prism"
else
if( powered() )
if(src.enabled)
if(src.lasers)
icon_state = "orange_target_prism"
else
icon_state = "target_prism"
else
icon_state = "grey_target_prism"
stat &= ~NOPOWER
else
spawn(rand(0, 15))
src.icon_state = "grey_target_prism"
stat |= NOPOWER
/obj/machinery/turret/proc/setState(var/enabled, var/lethal)
src.enabled = enabled
src.lasers = lethal
src.power_change()
/obj/machinery/turret/proc/get_protected_area()
var/area/turret_protected/TP = get_area(src)
if(istype(TP))
return TP
return
/obj/machinery/turret/proc/check_target(var/atom/movable/T as mob|obj)
if( T && T in protected_area.turretTargets )
var/area/area_T = get_area(T)
if( !area_T || (area_T.type != protected_area.type) )
protected_area.Exited(T)
return 0 //If the guy is somehow not in the turret's area (teleportation), get them out the damn list. --NEO
if( iscarbon(T) )
var/mob/living/carbon/MC = T
if( !MC.stat )
if( !MC.lying || lasers )
return 1
else if( istype(T, /obj/mecha) )
var/obj/mecha/ME = T
if( ME.occupant )
return 1
else if( istype(T, /obj/spacepod) )
var/obj/spacepod/SP = T
if( SP.pilot )
return 1
else if(istype(T,/mob/living/simple_animal))
var/mob/living/simple_animal/A = T
if( !A.stat )
if(lasers)
return 1
return 0
/obj/machinery/turret/proc/get_new_target()
var/list/new_targets = new
var/new_target
for(var/mob/living/carbon/M in protected_area.turretTargets)
if(!M.stat)
if(!M.lying || lasers)
new_targets += M
for(var/obj/mecha/M in protected_area.turretTargets)
if(M.occupant)
new_targets += M
for(var/obj/spacepod/M in protected_area.turretTargets)
if(M.pilot)
new_targets += M.pilot
for(var/mob/living/simple_animal/M in protected_area.turretTargets)
if(!M.stat)
new_targets += M
if(new_targets.len)
new_target = pick(new_targets)
return new_target
/obj/machinery/turret/process()
if(stat & (NOPOWER|BROKEN))
return
if(src.cover==null)
src.cover = new /obj/machinery/turretcover(src.loc)
src.cover.host = src
protected_area = get_protected_area()
if(!enabled || !protected_area || protected_area.turretTargets.len<=0)
if(!isDown() && !isPopping())
popDown()
return
if(!check_target(cur_target)) //if current target fails target check
cur_target = get_new_target() //get new target
if(cur_target) //if it's found, proceed
// to_chat(world, "[cur_target]")
if(!isPopping())
if(isDown())
popUp()
use_power = 2
else
spawn()
if(!targeting_active)
targeting_active = 1
target()
targeting_active = 0
if(prob(15))
if(prob(50))
playsound(get_turf(src), 'sound/effects/turret/move1.wav', 60, 1)
else
playsound(get_turf(src), 'sound/effects/turret/move2.wav', 60, 1)
else if(!isPopping())//else, pop down
if(!isDown())
popDown()
use_power = 1
return
/obj/machinery/turret/proc/target()
while(src && enabled && !stat && check_target(cur_target))
src.dir = get_dir(src, cur_target)
shootAt(cur_target)
sleep(shot_delay)
return
/obj/machinery/turret/proc/shootAt(var/atom/movable/target)
var/turf/T = get_turf(src)
var/turf/U = get_turf(target)
if(!T || !U)
return
var/obj/item/projectile/A
if(src.lasers)
switch(lasertype)
if(1)
A = new /obj/item/projectile/beam(loc)
if(2)
A = new /obj/item/projectile/beam/laser/heavylaser(loc)
if(3)
A = new /obj/item/projectile/beam/pulse(loc)
if(4)
A = new /obj/item/projectile/magic/change(loc)
if(5)
A = new /obj/item/projectile/beam/lasertag/bluetag(loc)
if(6)
A = new /obj/item/projectile/beam/lasertag/redtag(loc)
use_power(500)
else
A = new /obj/item/projectile/energy/electrode( loc )
use_power(200)
if(src.lasers)
playsound(get_turf(src), 'sound/weapons/Laser.ogg', 60, 1)
else
playsound(get_turf(src), 'sound/weapons/Taser.ogg', 60, 1)
A.original = target
A.current = T
A.yo = U.y - T.y
A.xo = U.x - T.x
A.fire()
return A
/obj/machinery/turret/proc/isDown()
return (invisibility!=0)
/obj/machinery/turret/proc/popUp()
if((!isPopping()) || src.popping==-1)
invisibility = 0
popping = 1
playsound(get_turf(src), 'sound/effects/turret/open.wav', 60, 1)
if(src.cover!=null)
flick("popup", src.cover)
src.cover.icon_state = "openTurretCover"
spawn(10)
if(popping==1) popping = 0
/obj/machinery/turret/proc/popDown()
if((!isPopping()) || src.popping==1)
popping = -1
playsound(get_turf(src), 'sound/effects/turret/open.wav', 60, 1)
if(src.cover!=null)
flick("popdown", src.cover)
src.cover.icon_state = "turretCover"
spawn(10)
if(popping==-1)
invisibility = INVISIBILITY_LEVEL_TWO
popping = 0
/obj/machinery/turret/bullet_act(var/obj/item/projectile/Proj)
if((Proj.damage_type == BRUTE || Proj.damage_type == BURN))
src.health -= Proj.damage
..()
if(prob(45) && Proj.damage > 0) src.spark_system.start()
qdel(Proj)
if(src.health <= 0)
src.die()
return
/obj/machinery/turret/attackby(obj/item/weapon/W, mob/user)//I can't believe no one added this before/N
..()
user.changeNext_move(CLICK_CD_MELEE)
playsound(src.loc, 'sound/weapons/smash.ogg', 60, 1)
src.spark_system.start()
src.health -= W.force * 0.5
if(src.health <= 0)
src.die()
return
/obj/machinery/turret/emp_act(severity)
switch(severity)
if(1)
enabled = 0
lasers = 0
power_change()
..()
/obj/machinery/turret/ex_act(severity)
if(severity < 3)
src.die()
/obj/machinery/turret/proc/die()
src.health = 0
src.density = 0
src.stat |= BROKEN
src.icon_state = "destroyed_target_prism"
if(cover!=null)
qdel(cover)
sleep(3)
flick("explosion", src)
spawn(13)
qdel(src)
/obj/machinery/turret/attack_animal(mob/living/simple_animal/M as mob)
M.changeNext_move(CLICK_CD_MELEE)
M.do_attack_animation(src)
if(M.melee_damage_upper == 0) return
if(!(stat & BROKEN))
visible_message("<span class='userdanger'>[M] [M.attacktext] [src]!</span>")
add_logs(src, M, "attacked", admin=0)
//src.attack_log += text("\[[time_stamp()]\] <font color='orange'>was attacked by [M.name] ([M.ckey])</font>")
src.health -= M.melee_damage_upper
if(src.health <= 0)
src.die()
else
to_chat(M, "<span class='danger'>That object is useless to you.</span>")
return
/obj/machinery/turret/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
M.changeNext_move(CLICK_CD_MELEE)
M.do_attack_animation(src)
if(!(stat & BROKEN))
playsound(src.loc, 'sound/weapons/slash.ogg', 25, 1, -1)
visible_message("<span class='userdanger'>[M] has slashed at [src]!</span>")
src.health -= 15
if(src.health <= 0)
src.die()
else
to_chat(M, "\green That object is useless to you.")
return
/obj/machinery/turretid/Topic(href, href_list, var/nowindow = 0)
if(..(href, href_list))
return 1
if(src.locked)
if(!istype(usr, /mob/living/silicon))
to_chat(usr, "Control panel is locked!")
return
if(href_list["toggleOn"])
src.enabled = !src.enabled
src.updateTurrets()
else if(href_list["toggleLethal"])
src.lethal = !src.lethal
src.updateTurrets()
if(!nowindow)
src.attack_hand(usr)
/obj/machinery/turretid/proc/update_icons()
if(src.enabled)
if(src.lethal)
icon_state = "control_kill"
else
icon_state = "control_stun"
else
icon_state = "control_standby"
//CODE FIXED BUT REMOVED
// if(control_area) //USE: updates other controls in the area
// for(var/obj/machinery/turretid/Turret_Control in world) //I'm not sure if this is what it was
// if( Turret_Control.control_area != src.control_area ) continue //supposed to do. Or whether the person
// Turret_Control.icon_state = icon_state //who coded it originally was just tired
// Turret_Control.enabled = enabled //or something. I don't see any situation
// Turret_Control.lethal = lethal //in which this would be used on the current map.
//If he wants it back he can uncomment it
/obj/machinery/gun_turret //related to turrets but work way differentely because of being mounted on a moving ship.
name = "machine gun turret"
desc = "Syndicate heavy defense turret. It really packs a bunch."
density = 1
anchored = 1
var/state = 0 //Like stat on mobs, 0 is alive, 1 is damaged, 2 is dead
var/faction = "syndicate"
var/atom/cur_target = null
var/scan_range = 9 //You will never see them coming
var/health = 200 //Because it lacks a cover, and is mostly to keep people from touching the syndie shuttle.
var/bullet_type = /obj/item/projectile/bullet
var/firing_sound = 'sound/weapons/Gunshot3.ogg'
var/base_icon = "syndieturret"
icon = 'icons/obj/turrets.dmi'
icon_state = "syndieturret0"
/obj/machinery/gun_turret/New()
..()
take_damage(0) //check your health
/obj/machinery/gun_turret/ex_act(severity)
switch(severity)
if(1)
die()
if(2)
take_damage(100)
if(3)
take_damage(50)
return
/obj/machinery/gun_turret/emp_act() //Can't emp an mechanical turret.
return
/obj/machinery/gun_turret/update_icon()
if(state > 2 || state < 0) //someone fucked up the vars so fix them
take_damage(0)
icon_state = "[base_icon]" + "[state]"
return
/obj/machinery/gun_turret/proc/take_damage(damage)
health -= damage
var/orig_health = initial(health)
var/health_percent = (health/orig_health) * 100
if(health_percent > 50)
state = 0
else
state = 1
if(health_percent <= 0)
if(state != 2)
die()
return
state = 2
update_icon()
/obj/machinery/gun_turret/bullet_act(var/obj/item/projectile/Proj)
if((Proj.damage_type == BRUTE || Proj.damage_type == BURN))
take_damage(Proj.damage)
return
/obj/machinery/gun_turret/proc/die()
state = 2
update_icon()
/obj/machinery/gun_turret/attack_hand(mob/user)
return
/obj/machinery/gun_turret/attack_ai(mob/user)
return attack_hand(user)
/obj/machinery/gun_turret/attack_alien(mob/living/user as mob)
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src)
playsound(src.loc, 'sound/weapons/slash.ogg', 25, 1, -1)
user.visible_message("[user] slashes at [src]", "You slash at [src]")
take_damage(15)
return
/obj/machinery/gun_turret/proc/validate_target(atom/target)
if(get_dist(target, src)>scan_range)
return 0
if(istype(target, /mob))
var/mob/M = target
if(!M.stat)
return 1
else if(istype(target, /obj/mecha))
var/obj/mecha/M = target
if(M.occupant)
return 1
else if(istype(target, /obj/spacepod))
var/obj/spacepod/S = target
if(S.pilot)
return 1
return 0
/obj/machinery/gun_turret/process()
if(state == 2)
return
if(cur_target && !validate_target(cur_target))
cur_target = null
if(!cur_target)
cur_target = get_target()
if(cur_target)
fire(cur_target)
return
/obj/machinery/gun_turret/proc/get_target()
var/list/pos_targets = list()
var/target = null
for(var/mob/living/M in view(scan_range,src))
if(M.stat)
continue
if(faction in M.faction)
continue
if(ispAI(M))
continue
pos_targets += M
for(var/obj/mecha/M in oview(scan_range, src))
if(M.occupant)
if(faction in M.occupant.faction)
continue
if(!M.occupant)
continue //Don't shoot at empty mechs.
pos_targets += M
for(var/obj/spacepod/M in oview(scan_range, src))
if(M.pilot)
var/mob/P = M.pilot
if(faction in P.faction)
continue
if(!M.pilot)
continue //Don't shoot at empty pods.
pos_targets += M
if(pos_targets.len)
target = pick(pos_targets)
return target
/obj/machinery/gun_turret/proc/fire(atom/target)
if(!target)
cur_target = null
return
src.dir = get_dir(src,target)
var/turf/targloc = get_turf(target)
if(!src)
return
var/turf/curloc = get_turf(src)
if(!targloc || !curloc)
return
if(targloc == curloc)
return
playsound(get_turf(src), firing_sound, 60, 1)
var/obj/item/projectile/A = new bullet_type(curloc)
A.original = target
A.current = curloc
A.yo = targloc.y - curloc.y
A.xo = targloc.x - curloc.x
A.fire()
return
/obj/machinery/gun_turret/interior
name = "machine gun turret (.45)"
desc = "Syndicate interior defense turret chambered for .45 rounds. Designed to down intruders without damaging the hull."
bullet_type = /obj/item/projectile/bullet/midbullet
/obj/machinery/gun_turret/exterior
name = "machine gun turret (7.62)"
desc = "Syndicate exterior defense turret chambered for 7.62 rounds. Designed to down intruders with heavy calliber bullets."
bullet_type = /obj/item/projectile/bullet
/obj/machinery/gun_turret/grenade
name = "mounted grenade launcher (40mm)"
desc = "Syndicate 40mm grenade launcher defense turret. If you've had this much time to look at it, you're probably already dead."
bullet_type = /obj/item/projectile/bullet/a40mm
/obj/machinery/gun_turret/assault_pod
name = "machine gun turret (4.6x30mm)"
desc = "Syndicate exterior defense turret chambered for 4.6x30mm rounds. Designed to be fitted to assault pods, it uses low calliber bullets to save space."
health = 100
bullet_type = /obj/item/projectile/bullet/weakbullet3
+2
View File
@@ -92,6 +92,7 @@
processing_objects.Add(src)
removeVerb(/obj/mecha/verb/disconnect_from_port)
poi_list |= src
log_message("[src] created.")
mechas_list += src //global mech list
prepare_huds()
@@ -611,6 +612,7 @@
qdel(internal_tank)
processing_objects.Remove(src)
poi_list.Remove(src)
equipment.Cut()
cell = null
internal_tank = null
+5
View File
@@ -18,6 +18,11 @@
var/new_frequency = sanitize_frequency(rand(PUBLIC_LOW_FREQ, PUBLIC_HIGH_FREQ))
aSignal.set_frequency(new_frequency)
poi_list |= src
/obj/effect/anomaly/Destroy()
poi_list.Remove(src)
return ..()
/obj/effect/anomaly/proc/anomalyEffect()
if(prob(50))
+14
View File
@@ -262,3 +262,17 @@
new /obj/item/clothing/mask/gas/sexymime(src.loc)
new /obj/item/clothing/under/sexymime(src.loc)
qdel(src)
/obj/effect/landmark/ruin
var/datum/map_template/ruin/ruin_template
/obj/effect/landmark/ruin/New(loc, my_ruin_template)
name = "ruin_[ruin_landmarks.len + 1]"
..(loc)
ruin_template = my_ruin_template
ruin_landmarks |= src
/obj/effect/landmark/ruin/Destroy()
ruin_landmarks -= src
ruin_template = null
. = ..()
+5 -3
View File
@@ -1,4 +1,3 @@
/obj/effect/overlay
name = "overlay"
unacidable = 1
@@ -17,8 +16,8 @@
var/tmp/atom/BeamSource
New()
..()
spawn(10) qdel(src)
spawn(10)
qdel(src)
/obj/effect/overlay/temp
anchored = 1
@@ -30,6 +29,9 @@
/obj/effect/overlay/temp/New()
if(randomdir)
dir = pick(cardinal)
flick("[icon_state]", src) //Because we might be pulling it from a pool, flick whatever icon it uses so it starts at the start of the icon's animation.
spawn(duration)
qdel(src)
@@ -102,19 +102,41 @@ var/global/list/datum/stack_recipe/human_recipes = list( \
icon_state = "sheet-leather"
origin_tech = "materials=2"
/obj/item/stack/sheet/sinew
name = "watcher sinew"
icon = 'icons/obj/mining.dmi'
desc = "Long stringy filaments which presumably came from a watcher's wings."
singular_name = "watcher sinew"
icon_state = "sinew"
origin_tech = "biotech=4"
/obj/item/stack/sheet/animalhide/goliath_hide
name = "goliath hide plates"
desc = "Pieces of a goliath's rocky hide, these might be able to make your suit a bit more durable to attack from the local fauna."
icon = 'icons/obj/mining.dmi'
icon_state = "goliath_hide"
singular_name = "hide plate"
flags = NOBLUDGEON
w_class = 3
layer = MOB_LAYER
/obj/item/stack/sheet/animalhide/ashdrake
name = "ash drake hide"
desc = "The strong, scaled hide of an ash drake."
icon = 'icons/obj/mining.dmi'
icon_state = "dragon_hide"
singular_name = "drake plate"
flags = NOBLUDGEON
w_class = 3
layer = MOB_LAYER
//Step one - dehairing.
/obj/item/stack/sheet/animalhide/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
if( istype(W, /obj/item/weapon/kitchen/knife) || \
istype(W, /obj/item/weapon/twohanded/fireaxe) || \
istype(W, /obj/item/weapon/hatchet) )
//visible message on mobs is defined as visible_message(var/message, var/self_message, var/blind_message)
usr.visible_message("\blue \the [usr] starts cutting hair off \the [src]", "\blue You start cutting the hair off \the [src]", "You hear the sound of a knife rubbing against flesh")
if(W.sharp)
user.visible_message("[user] starts cutting hair off \the [src].", "<span class='notice'>You start cutting the hair off \the [src]...</span>", "<span class='italics'>You hear the sound of a knife rubbing against flesh.</span>")
if(do_after(user,50, target = src))
to_chat(usr, "\blue You cut the hair from this [src.singular_name]")
user << "<span class='notice'>You cut the hair from this [src.singular_name].</span>"
//Try locating an exisitng stack on the tile and add to there if possible
for(var/obj/item/stack/sheet/hairlesshide/HS in usr.loc)
if(HS.amount < 50)
@@ -128,7 +150,6 @@ var/global/list/datum/stack_recipe/human_recipes = list( \
else
..()
//Step two - washing..... it's actually in washing machine code.
//Step three - drying
@@ -201,3 +201,19 @@ var/global/list/datum/stack_recipe/cardboard_recipes = list (
/obj/item/stack/sheet/cardboard/New(var/loc, var/amt = null)
recipes = cardboard_recipes
return ..()
/*
* Bones
*/
/obj/item/stack/sheet/bone
name = "bones"
icon = 'icons/obj/mining.dmi'
icon_state = "bone"
singular_name = "bone"
desc = "Someone's been drinking their milk."
force = 7
throwforce = 5
w_class = 3
throw_speed = 1
throw_range = 3
origin_tech = "materials=2;biotech=2"
@@ -20,6 +20,7 @@
for(var/i=1, i<=deliveryamt, i++)
var/atom/movable/x = new spawner_type
x.admin_spawned = admin_spawned
x.loc = T
if(prob(50))
for(var/j = 1, j <= rand(1, 3), j++)