Merge pull request #8641 from PsiOmegaDelta/CultVisualNetwork

Cult Visual network
This commit is contained in:
Chinsky
2015-04-06 20:19:49 +03:00
23 changed files with 190 additions and 46 deletions

View File

@@ -1051,13 +1051,24 @@
#include "code\modules\mob\typing_indicator.dm" #include "code\modules\mob\typing_indicator.dm"
#include "code\modules\mob\update_icons.dm" #include "code\modules\mob\update_icons.dm"
#include "code\modules\mob\dead\death.dm" #include "code\modules\mob\dead\death.dm"
#include "code\modules\mob\dead\observer\login.dm"
#include "code\modules\mob\dead\observer\logout.dm" #include "code\modules\mob\dead\observer\logout.dm"
#include "code\modules\mob\dead\observer\observer.dm" #include "code\modules\mob\dead\observer\observer.dm"
#include "code\modules\mob\dead\observer\say.dm" #include "code\modules\mob\dead\observer\say.dm"
#include "code\modules\mob\freelook\chunk.dm" #include "code\modules\mob\freelook\chunk.dm"
#include "code\modules\mob\freelook\eye.dm" #include "code\modules\mob\freelook\eye.dm"
#include "code\modules\mob\freelook\life.dm"
#include "code\modules\mob\freelook\read_me.dm"
#include "code\modules\mob\freelook\update_triggers.dm" #include "code\modules\mob\freelook\update_triggers.dm"
#include "code\modules\mob\freelook\visualnet.dm" #include "code\modules\mob\freelook\visualnet.dm"
#include "code\modules\mob\freelook\ai\cameranet.dm"
#include "code\modules\mob\freelook\ai\chunk.dm"
#include "code\modules\mob\freelook\ai\eye.dm"
#include "code\modules\mob\freelook\ai\update_triggers.dm"
#include "code\modules\mob\freelook\mask\chunk.dm"
#include "code\modules\mob\freelook\mask\cultnet.dm"
#include "code\modules\mob\freelook\mask\eye.dm"
#include "code\modules\mob\freelook\mask\update_triggers.dm"
#include "code\modules\mob\language\generic.dm" #include "code\modules\mob\language\generic.dm"
#include "code\modules\mob\language\language.dm" #include "code\modules\mob\language\language.dm"
#include "code\modules\mob\language\monkey.dm" #include "code\modules\mob\language\monkey.dm"
@@ -1174,11 +1185,6 @@
#include "code\modules\mob\living\silicon\ai\logout.dm" #include "code\modules\mob\living\silicon\ai\logout.dm"
#include "code\modules\mob\living\silicon\ai\say.dm" #include "code\modules\mob\living\silicon\ai\say.dm"
#include "code\modules\mob\living\silicon\ai\subsystems.dm" #include "code\modules\mob\living\silicon\ai\subsystems.dm"
#include "code\modules\mob\living\silicon\ai\freelook\cameranet.dm"
#include "code\modules\mob\living\silicon\ai\freelook\chunk.dm"
#include "code\modules\mob\living\silicon\ai\freelook\eye.dm"
#include "code\modules\mob\living\silicon\ai\freelook\read_me.dm"
#include "code\modules\mob\living\silicon\ai\freelook\update_triggers.dm"
#include "code\modules\mob\living\silicon\decoy\death.dm" #include "code\modules\mob\living\silicon\decoy\death.dm"
#include "code\modules\mob\living\silicon\decoy\decoy.dm" #include "code\modules\mob\living\silicon\decoy\decoy.dm"
#include "code\modules\mob\living\silicon\decoy\life.dm" #include "code\modules\mob\living\silicon\decoy\life.dm"

View File

@@ -49,6 +49,11 @@ var/global/list/undershirt_t = list("White Tank top" = "u1", "Black Tank top" =
//Backpacks //Backpacks
var/global/list/backbaglist = list("Nothing", "Backpack", "Satchel", "Satchel Alt") var/global/list/backbaglist = list("Nothing", "Backpack", "Satchel", "Satchel Alt")
var/global/list/exclude_jobs = list(/datum/job/ai,/datum/job/cyborg) var/global/list/exclude_jobs = list(/datum/job/ai,/datum/job/cyborg)
// Visual nets
var/list/datum/visualnet/visual_nets = list()
var/datum/visualnet/camera/cameranet = new()
var/datum/visualnet/cult/cultnet = new()
////////////////////////// //////////////////////////
/////Initial Building///// /////Initial Building/////
////////////////////////// //////////////////////////

View File

@@ -33,7 +33,7 @@ var/list/global_huds = list(
screen.screen_loc = "1,1" screen.screen_loc = "1,1"
screen.icon = 'icons/obj/hud_full.dmi' screen.icon = 'icons/obj/hud_full.dmi'
screen.icon_state = icon_state screen.icon_state = icon_state
screen.layer = 17 screen.layer = SCREEN_LAYER
screen.mouse_opacity = 0 screen.mouse_opacity = 0
return screen return screen

View File

@@ -8,4 +8,4 @@
required_enemies = 3 required_enemies = 3
uplink_welcome = "Nar-Sie Uplink Console:" uplink_welcome = "Nar-Sie Uplink Console:"
end_on_antag_death = 1 end_on_antag_death = 1
antag_tag = MODE_CULTIST antag_tag = MODE_CULTIST

View File

@@ -1,7 +1,4 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 //This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
#define DOOR_OPEN_LAYER 2.7 //Under all objects if opened. 2.7 due to tables being at 2.6
#define DOOR_CLOSED_LAYER 3.1 //Above most items if closed
#define DOOR_REPAIR_AMOUNT 50 //amount of health regained per stack amount used #define DOOR_REPAIR_AMOUNT 50 //amount of health regained per stack amount used
/obj/machinery/door /obj/machinery/door

View File

@@ -2,8 +2,6 @@
// //
// The datum containing all the chunks. // The datum containing all the chunks.
var/datum/visualnet/camera/cameranet = new()
/datum/visualnet/camera /datum/visualnet/camera
// The cameras on the map, no matter if they work or not. Updated in obj/machinery/camera.dm by New() and Del(). // The cameras on the map, no matter if they work or not. Updated in obj/machinery/camera.dm by New() and Del().
var/list/cameras = list() var/list/cameras = list()

View File

@@ -101,7 +101,7 @@
var/turf/t = turf var/turf/t = turf
if(obscuredTurfs[t]) if(obscuredTurfs[t])
if(!t.obfuscations[obfuscation.type]) if(!t.obfuscations[obfuscation.type])
t.obfuscations[obfuscation.type] = image(obfuscation.icon, t, obfuscation.icon_state, 15) t.obfuscations[obfuscation.type] = image(obfuscation.icon, t, obfuscation.icon_state, OBFUSCATION_LAYER)
obscured += t.obfuscations[obfuscation.type] obscured += t.obfuscations[obfuscation.type]
for(var/eye in seenby) for(var/eye in seenby)
@@ -140,7 +140,7 @@
for(var/turf in obscuredTurfs) for(var/turf in obscuredTurfs)
var/turf/t = turf var/turf/t = turf
if(!t.obfuscations[obfuscation.type]) if(!t.obfuscations[obfuscation.type])
t.obfuscations[obfuscation.type] = image(obfuscation.icon, t, obfuscation.icon_state, 15) t.obfuscations[obfuscation.type] = image(obfuscation.icon, t, obfuscation.icon_state, OBFUSCATION_LAYER)
obscured += t.obfuscations[obfuscation.type] obscured += t.obfuscations[obfuscation.type]
#undef UPDATE_BUFFER #undef UPDATE_BUFFER

View File

@@ -12,6 +12,7 @@
var/sprint = 10 var/sprint = 10
var/cooldown = 0 var/cooldown = 0
var/acceleration = 1 var/acceleration = 1
var/owner_follows_eye = 0
see_in_dark = 7 see_in_dark = 7
status_flags = GODMODE status_flags = GODMODE
@@ -40,7 +41,9 @@ mob/eye/Del()
..() ..()
// Movement code. Returns 0 to stop air movement from moving it. // Movement code. Returns 0 to stop air movement from moving it.
/mob/eye/Move() /mob/eye/Move(n, direct)
if(owner == src)
EyeMove(n, direct)
return 0 return 0
/mob/eye/examinate() /mob/eye/examinate()
@@ -60,15 +63,35 @@ mob/eye/Del()
/mob/eye/proc/setLoc(var/T) /mob/eye/proc/setLoc(var/T)
if(owner) if(owner)
T = get_turf(T) T = get_turf(T)
loc = T if(T != loc)
loc = T
if(owner.client) if(owner.client)
owner.client.eye = src owner.client.eye = src
visualnet.visibility(src) if(owner_follows_eye)
return 1 visualnet.updateVisibility(owner, 0)
owner.loc = loc
visualnet.updateVisibility(owner, 0)
visualnet.visibility(src)
return 1
return 0 return 0
/mob/eye/proc/getLoc()
if(owner)
if(!isturf(owner.loc) || !owner.client)
return
return loc
/mob
var/mob/eye/eyeobj
/mob/proc/EyeMove(n, direct)
if(!eyeobj)
return
return eyeobj.EyeMove(n, direct)
/mob/eye/EyeMove(n, direct) /mob/eye/EyeMove(n, direct)
var/initial = initial(sprint) var/initial = initial(sprint)
var/max_sprint = 50 var/max_sprint = 50
@@ -86,18 +109,3 @@ mob/eye/Del()
sprint = min(sprint + 0.5, max_sprint) sprint = min(sprint + 0.5, max_sprint)
else else
sprint = initial sprint = initial
/mob/eye/proc/getLoc()
if(owner)
if(!isturf(owner.loc) || !owner.client)
return
return loc
/mob
var/mob/eye/eyeobj
/mob/proc/EyeMove(n, direct)
if(!eyeobj)
return
return eyeobj.EyeMove(n, direct)

View File

@@ -0,0 +1,7 @@
/mob/eye/Life()
..()
// If we lost our client, reset the list of visible chunks so they update properly on return
if(owner == src && !client)
visibleChunks.Cut()
/*else if(owner && !owner.client)
visibleChunks.Cut()*/

View File

@@ -0,0 +1,39 @@
// CULT CHUNK
//
// A 16x16 grid of the map with a list of turfs that can be seen, are visible and are dimmed.
// Allows the Eye to stream these chunks and know what it can and cannot see.
/datum/obfuscation/cult
icon_state = "white"
/datum/chunk/cult
obfuscation = new /datum/obfuscation/cult()
/datum/chunk/cult/acquireVisibleTurfs(var/list/visible)
for(var/mob/living/L in living_mob_list)
for(var/turf/t in L.seen_turfs())
visible[t] = t
/mob/living/proc/seen_turfs()
return seen_turfs_in_range(src, 3)
/mob/living/carbon/human/seen_turfs()
/*if(src.isSynthetic())
return list()*/
if(mind in cult.current_antagonists)
return seen_turfs_in_range(src, client ? client.view : 7)
return ..()
/mob/living/silicon/seen_turfs()
return list()
/mob/living/simple_animal/seen_turfs()
return seen_turfs_in_range(src, 1)
/mob/living/simple_animal/shade/narsie/seen_turfs()
return view(2, src)
/proc/seen_turfs_in_range(var/source, var/range)
var/turf/pos = get_turf(source)
return hear(range, pos)

View File

@@ -0,0 +1,15 @@
// CULT NET
//
// The datum containing all the chunks.
/datum/visualnet/cult
chunk_type = /datum/chunk/cult
/datum/visualnet/cult/proc/provides_vision(var/mob/living/L)
return L.provides_cult_vision()
/mob/living/proc/provides_cult_vision()
return 1
/mob/living/silicon/provides_cult_vision()
return 0

View File

@@ -0,0 +1,13 @@
// MASK EYE
//
// A mob that a cultists controls to look around the station with.
// It streams chunks as it moves around, which will show it what the cultist can and cannot see.
/mob/eye/maskEye
name = "Eye of Nar-Sie"
acceleration = 0
owner_follows_eye = 1
/mob/eye/maskEye/New()
..()
visualnet = cultnet

View File

@@ -0,0 +1,50 @@
//UPDATE TRIGGERS, when the chunk (and the surrounding chunks) should update.
#define CULT_UPDATE_BUFFER 30
/mob/living/var/updating_cult_vision = 0
/mob/living/Move()
var/oldLoc = src.loc
. = ..()
if(.)
if(cultnet.provides_vision(src))
if(!updating_cult_vision)
updating_cult_vision = 1
spawn(CULT_UPDATE_BUFFER)
if(oldLoc != src.loc)
cultnet.updateVisibility(oldLoc, 0)
cultnet.updateVisibility(loc, 0)
updating_cult_vision = 0
#undef CULT_UPDATE_BUFFER
/mob/living/New()
..()
cultnet.updateVisibility(src, 0)
/mob/living/Del()
cultnet.updateVisibility(src, 0)
..()
/mob/living/rejuvenate()
var/was_dead = stat == DEAD
..()
if(was_dead && stat != DEAD)
// Arise!
cultnet.updateVisibility(src, 0)
/mob/living/death()
if(..())
// If true, the mob went from living to dead (assuming everyone has been overriding as they should...)
cultnet.updateVisibility(src)
/datum/antagonist/add_antagonist(var/datum/mind/player)
..()
if(src == cult)
cultnet.updateVisibility(player.current, 0)
/datum/antagonist/remove_antagonist(var/datum/mind/player, var/show_message, var/implanted)
..()
if(src == cult)
cultnet.updateVisibility(player.current, 0)

View File

@@ -2,8 +2,6 @@
// //
// The datum containing all the chunks. // The datum containing all the chunks.
var/global/list/visual_nets = new()
/datum/visualnet /datum/visualnet
// The chunks of the map, mapping the areas that an object can see. // The chunks of the map, mapping the areas that an object can see.
var/list/chunks = list() var/list/chunks = list()

View File

@@ -46,4 +46,4 @@
if(istype(L)) if(istype(L))
if(prob(12)) if(prob(12))
L.Weaken(3) L.Weaken(3)
L.visible_message("<span class='danger'>\the [src] knocks down \the [L]!</span>") L.visible_message("<span class='danger'>\the [src] knocks down \the [L]!</span>")

View File

@@ -30,6 +30,14 @@
/mob/living/simple_animal/shade/Life() /mob/living/simple_animal/shade/Life()
..() ..()
OnDeathInLife()
/mob/living/simple_animal/shade/attackby(var/obj/item/O as obj, var/mob/user as mob) //Marker -Agouri
if(istype(O, /obj/item/device/soulstone))
O.transfer_soul("SHADE", src, user)
return
/mob/living/simple_animal/shade/proc/OnDeathInLife()
if(stat == 2) if(stat == 2)
new /obj/item/weapon/ectoplasm (src.loc) new /obj/item/weapon/ectoplasm (src.loc)
for(var/mob/M in viewers(src, null)) for(var/mob/M in viewers(src, null))
@@ -38,10 +46,3 @@
ghostize() ghostize()
del src del src
return return
/mob/living/simple_animal/shade/attackby(var/obj/item/O as obj, var/mob/user as mob) //Marker -Agouri
if(istype(O, /obj/item/device/soulstone))
O.transfer_soul("SHADE", src, user)
return
return ..()

View File

@@ -350,7 +350,7 @@
var/obj/machinery/bot/B = target_mob var/obj/machinery/bot/B = target_mob
if(B.health > 0) if(B.health > 0)
return (0) return (0)
return (1) return 1
//Call when target overlay should be added/removed //Call when target overlay should be added/removed
/mob/living/simple_animal/update_targeted() /mob/living/simple_animal/update_targeted()

View File

@@ -864,3 +864,10 @@ var/list/be_special_flags = list(
#define DROPLIMB_EDGE 0 #define DROPLIMB_EDGE 0
#define DROPLIMB_BLUNT 1 #define DROPLIMB_BLUNT 1
#define DROPLIMB_BURN 2 #define DROPLIMB_BURN 2
// Custom layer definitions, supplementing the default TURF_LAYER, MOB_LAYER, etc.
#define DOOR_OPEN_LAYER 2.7 //Under all objects if opened. 2.7 due to tables being at 2.6
#define DOOR_CLOSED_LAYER 3.1 //Above most items if closed
#define OBFUSCATION_LAYER 14 //Where images covering the view for eyes are put
#define SCREEN_LAYER 17 //Mob HUD/effects layer

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 31 KiB