mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 12:37:26 +01:00
Updates handheld-flashes so that they cannot break on their first use. Their chance of breaking is directly proportional to their frequency of use (ranges from 0% to 5%, used to be a blanket 2%). Their capacitor recharges one charge every 60 seconds. Once their 6 charges are used up, they temporarily stop working whilst their capacitor recharges. This should mean that flashes will last a long time with light use (defence/rev), but not for spamming (shitcurity).
Can now job-ban people from entire departments through the jobban panel. Can now job-ban people even if they log out. Job-ban panel now informs you why people were banned from each job. Runtime fixes for some old jobban code that was preventing the above stuff. Committing some fixes Nodrak pointed out. Credits go to Nodrak for a lot of this. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3285 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -89,6 +89,7 @@
|
||||
if(istype(O,/obj/item/device/flash))
|
||||
if(O:broken)
|
||||
O:broken = 0
|
||||
O:times_used = 0
|
||||
O:icon_state = "flash"
|
||||
if(istype(O,/obj/item/weapon/gun/energy/taser/cyborg))
|
||||
if(O:power_supply.charge < O:power_supply.maxcharge)
|
||||
|
||||
+132
-138
@@ -10,166 +10,160 @@
|
||||
item_state = "electronic"
|
||||
origin_tech = "magnets=2;combat=1"
|
||||
|
||||
var
|
||||
shots_left = 5
|
||||
max_shots = 5
|
||||
broken = 0
|
||||
var/times_used = 0 //Number of times it's been used.
|
||||
var/broken = 0 //Is the flash burnt out?
|
||||
var/last_used = 0 //last world.time it was used.
|
||||
|
||||
proc
|
||||
clown_check(var/mob/user)
|
||||
recharge()
|
||||
/obj/item/device/flash/proc/clown_check(var/mob/user)
|
||||
if((user.mutations & CLUMSY) && prob(50))
|
||||
user << "\red The Flash slips out of your hand."
|
||||
user.drop_item()
|
||||
return 0
|
||||
return 1
|
||||
|
||||
|
||||
/obj/item/device/flash/attack(mob/living/M as mob, mob/user as mob)
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been flashed (attempt) with [src.name] by [user.name] ([user.ckey])</font>")
|
||||
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [src.name] to flash [M.name] ([M.ckey])</font>")
|
||||
|
||||
log_attack("<font color='red'>[user.name] ([user.ckey]) Used the [src.name] to flash [M.name] ([M.ckey])</font>")
|
||||
|
||||
|
||||
attack(mob/living/M as mob, mob/user as mob)
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been flashed (attempt) with [src.name] by [user.name] ([user.ckey])</font>")
|
||||
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [src.name] to flash [M.name] ([M.ckey])</font>")
|
||||
if(!clown_check(user)) return
|
||||
if(broken)
|
||||
user.show_message("\red The [src.name] is broken", 2)
|
||||
return
|
||||
|
||||
log_attack("<font color='red'>[user.name] ([user.ckey]) Used the [src.name] to flash [M.name] ([M.ckey])</font>")
|
||||
//capacitor recharges over time
|
||||
for(var/i=0, i<3, i++)
|
||||
if(last_used+600 > world.time)
|
||||
break
|
||||
last_used += 600
|
||||
times_used--
|
||||
|
||||
|
||||
if(!clown_check(user)) return
|
||||
if(broken)
|
||||
user.show_message("\red The [src.name] is broken", 2)
|
||||
return
|
||||
|
||||
if(shots_left <= 0)
|
||||
//spamming the flash before it's fully charged (60seconds) increases the chance of it breaking
|
||||
//It will never break on the first use.
|
||||
times_used = max(0,round(times_used)) //sanity
|
||||
switch(times_used)
|
||||
if(0 to 5)
|
||||
last_used = world.time
|
||||
if(prob(times_used)) //if you use it 5 times in a minute it has a 10% chance to break!
|
||||
broken = 1
|
||||
user << "\red The bulb has burnt out!"
|
||||
icon_state = "flashburnt"
|
||||
return
|
||||
times_used++
|
||||
else //can only use it 5 times a minute
|
||||
user.show_message("\red *click* *click*", 2)
|
||||
return
|
||||
playsound(src.loc, 'flash.ogg', 100, 1)
|
||||
var/flashfail = 0
|
||||
|
||||
playsound(src.loc, 'flash.ogg', 100, 1)
|
||||
shots_left--
|
||||
var/flashfail = 0
|
||||
if(iscarbon(M))
|
||||
var/safety = M:eyecheck()
|
||||
if(safety <= 0)
|
||||
M.Weaken(10)
|
||||
flick("e_flash", M.flash)
|
||||
|
||||
if(iscarbon(M))
|
||||
var/safety = M:eyecheck()
|
||||
if(safety <= 0)
|
||||
M.Weaken(10)
|
||||
flick("e_flash", M.flash)
|
||||
|
||||
if(ishuman(M) && ishuman(user))
|
||||
if(user.mind in ticker.mode.head_revolutionaries)
|
||||
var/revsafe = 0
|
||||
for(var/obj/item/weapon/implant/loyalty/L in M)
|
||||
if(L && L.implanted)
|
||||
revsafe = 1
|
||||
break
|
||||
if(M.mind.has_been_rev)
|
||||
revsafe = 2
|
||||
if(!revsafe)
|
||||
M.mind.has_been_rev = 1
|
||||
ticker.mode.add_revolutionary(M.mind)
|
||||
else if(revsafe == 1)
|
||||
user << "\red Something seems to be blocking the flash!"
|
||||
else
|
||||
user << "\red This mind seems resistant to the flash!"
|
||||
else
|
||||
flashfail = 1
|
||||
|
||||
else if(issilicon(M))
|
||||
M.Weaken(rand(5,10))
|
||||
|
||||
if(isrobot(user))
|
||||
spawn(0)
|
||||
var/atom/movable/overlay/animation = new(user.loc)
|
||||
animation.layer = user.layer + 1
|
||||
animation.icon_state = "blank"
|
||||
animation.icon = 'mob.dmi'
|
||||
animation.master = user
|
||||
flick("blspell", animation)
|
||||
sleep(5)
|
||||
del(animation)
|
||||
|
||||
|
||||
if(!flashfail)
|
||||
for(var/mob/O in viewers(user, null))
|
||||
O.show_message(text("\red [] blinds [] with the flash!", user, M))
|
||||
if(ishuman(M) && ishuman(user))
|
||||
if(user.mind in ticker.mode.head_revolutionaries)
|
||||
var/revsafe = 0
|
||||
for(var/obj/item/weapon/implant/loyalty/L in M)
|
||||
if(L && L.implanted)
|
||||
revsafe = 1
|
||||
break
|
||||
if(M.mind.has_been_rev)
|
||||
revsafe = 2
|
||||
if(!revsafe)
|
||||
M.mind.has_been_rev = 1
|
||||
ticker.mode.add_revolutionary(M.mind)
|
||||
else if(revsafe == 1)
|
||||
user << "\red Something seems to be blocking the flash!"
|
||||
else
|
||||
user << "\red This mind seems resistant to the flash!"
|
||||
else
|
||||
for(var/mob/O in viewers(user, null))
|
||||
O.show_message(text("\blue [] fails to blind [] with the flash!", user, M))
|
||||
flashfail = 1
|
||||
|
||||
else if(issilicon(M))
|
||||
M.Weaken(rand(5,10))
|
||||
|
||||
if(isrobot(user))
|
||||
spawn(0)
|
||||
var/atom/movable/overlay/animation = new(user.loc)
|
||||
animation.layer = user.layer + 1
|
||||
animation.icon_state = "blank"
|
||||
animation.icon = 'mob.dmi'
|
||||
animation.master = user
|
||||
flick("blspell", animation)
|
||||
sleep(5)
|
||||
del(animation)
|
||||
|
||||
|
||||
if(!flashfail)
|
||||
for(var/mob/O in viewers(user, null))
|
||||
O.show_message(text("\red [] blinds [] with the flash!", user, M))
|
||||
else
|
||||
for(var/mob/O in viewers(user, null))
|
||||
O.show_message(text("\blue [] fails to blind [] with the flash!", user, M))
|
||||
|
||||
if (prob(2))
|
||||
broken = 1
|
||||
user << "\red The bulb has burnt out!"
|
||||
icon_state = "flashburnt"
|
||||
return
|
||||
|
||||
spawn(60)
|
||||
recharge()
|
||||
|
||||
/obj/item/device/flash/attack_self(mob/living/carbon/user as mob, flag = 0, emp = 0)
|
||||
if(!emp)
|
||||
if (!clown_check(user)) return
|
||||
if(broken)
|
||||
if(user)
|
||||
user.show_message("\red The [src.name] is broken", 2)
|
||||
return
|
||||
|
||||
//capacitor recharges over time
|
||||
for(var/i=0, i<3, i++)
|
||||
if(last_used+600 > world.time)
|
||||
break
|
||||
last_used += 600
|
||||
times_used -= 2
|
||||
last_used = world.time
|
||||
|
||||
attack_self(mob/living/carbon/user as mob, flag = 0, emp = 0)
|
||||
if(!emp)
|
||||
if (!clown_check(user)) return
|
||||
if(broken)
|
||||
if(user)
|
||||
user.show_message("\red The [src.name] is broken", 2)
|
||||
return
|
||||
|
||||
if(shots_left <= 0)
|
||||
if(user)
|
||||
user.show_message("\red *click* *click*", 2)
|
||||
return
|
||||
|
||||
playsound(src.loc, 'flash.ogg', 100, 1)
|
||||
shots_left--
|
||||
|
||||
flick("flash2", src)
|
||||
if(isrobot(user))
|
||||
spawn(0)
|
||||
var/atom/movable/overlay/animation = new(user.loc)
|
||||
animation.layer = user.layer + 1
|
||||
animation.icon_state = "blank"
|
||||
animation.icon = 'mob.dmi'
|
||||
animation.master = user
|
||||
flick("blspell", animation)
|
||||
sleep(5)
|
||||
del(animation)
|
||||
|
||||
for(var/mob/living/carbon/M in oviewers(3, null))
|
||||
if(prob(50))
|
||||
if (locate(/obj/item/weapon/cloaking_device, M))
|
||||
for(var/obj/item/weapon/cloaking_device/S in M)
|
||||
S.active = 0
|
||||
S.icon_state = "shield0"
|
||||
var/safety = M:eyecheck()
|
||||
if(!safety)
|
||||
flick("flash", M.flash)
|
||||
|
||||
if (prob(2))
|
||||
broken = 1
|
||||
icon_state = "flashburnt"
|
||||
if(user)
|
||||
//spamming the flash before it's fully charged (60seconds) increases the chance of it breaking
|
||||
//It will never break on the first use.
|
||||
times_used = max(0,round(times_used)) //sanity
|
||||
switch(times_used)
|
||||
if(0 to 5)
|
||||
if(prob(2*times_used)) //if you use it 5 times in a minute it has a 10% chance to break!
|
||||
broken = 1
|
||||
user << "\red The bulb has burnt out!"
|
||||
icon_state = "flashburnt"
|
||||
return
|
||||
times_used++
|
||||
else //can only use it 5 times a minute
|
||||
user.show_message("\red *click* *click*", 2)
|
||||
return
|
||||
playsound(src.loc, 'flash.ogg', 100, 1)
|
||||
flick("flash2", src)
|
||||
if(isrobot(user))
|
||||
spawn(0)
|
||||
var/atom/movable/overlay/animation = new(user.loc)
|
||||
animation.layer = user.layer + 1
|
||||
animation.icon_state = "blank"
|
||||
animation.icon = 'mob.dmi'
|
||||
animation.master = user
|
||||
flick("blspell", animation)
|
||||
sleep(5)
|
||||
del(animation)
|
||||
|
||||
spawn(60)
|
||||
recharge()
|
||||
for(var/mob/living/carbon/M in oviewers(3, null))
|
||||
if(prob(50))
|
||||
if (locate(/obj/item/weapon/cloaking_device, M))
|
||||
for(var/obj/item/weapon/cloaking_device/S in M)
|
||||
S.active = 0
|
||||
S.icon_state = "shield0"
|
||||
var/safety = M:eyecheck()
|
||||
if(!safety)
|
||||
flick("flash", M.flash)
|
||||
|
||||
return
|
||||
return
|
||||
|
||||
|
||||
emp_act(severity)
|
||||
src.attack_self(null,1,1)
|
||||
..()
|
||||
|
||||
|
||||
clown_check(var/mob/user)
|
||||
if((user.mutations & CLUMSY) && prob(50))
|
||||
user << "\red The Flash slips out of your hand."
|
||||
user.drop_item()
|
||||
return 0
|
||||
return 1
|
||||
|
||||
|
||||
recharge()
|
||||
if(max_shots > shots_left)
|
||||
shots_left++
|
||||
if(max_shots > shots_left)
|
||||
spawn(60)//more or less 10 seconds
|
||||
recharge()
|
||||
return
|
||||
/obj/item/device/flash/emp_act(severity)
|
||||
src.attack_self(null,1,1)
|
||||
..()
|
||||
|
||||
+140
-59
@@ -13,7 +13,6 @@
|
||||
|
||||
/obj/admins/Topic(href, href_list)
|
||||
..()
|
||||
|
||||
if (usr.client != src.owner)
|
||||
world << "\blue [usr.key] has attempted to override the admin panel!"
|
||||
log_admin("[key_name(usr)] tried to use the admin panel without authorization.")
|
||||
@@ -121,25 +120,30 @@
|
||||
|
||||
if(href_list["jobban2"])
|
||||
var/mob/M = locate(href_list["jobban2"])
|
||||
var/dat = ""
|
||||
var/header = "<b>Pick Job to ban this guy from.<br>"
|
||||
var/body
|
||||
var/jobs = ""
|
||||
if(!M) //sanity
|
||||
alert("Mob no longer exists!")
|
||||
return
|
||||
if(!M.ckey) //sanity
|
||||
alert("Mob has no ckey")
|
||||
return
|
||||
if(!job_master)
|
||||
usr << "Job Master has not been setup!"
|
||||
return
|
||||
var/dat = ""
|
||||
var/header = "<head><title>Job-Ban Panel: [M.name]</title></head>"
|
||||
var/body
|
||||
var/jobs = ""
|
||||
|
||||
/***********************************WARNING!************************************
|
||||
The jobban stuff looks mangled and disguisting
|
||||
The jobban stuff looks mangled and disgusting
|
||||
But it looks beautiful in-game
|
||||
-Nodrak
|
||||
************************************WARNING!***********************************/
|
||||
var/counter = 0
|
||||
|
||||
//Regular jobs
|
||||
//Command (Blue)
|
||||
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
|
||||
jobs += "<tr align='center' bgcolor='ccccff'><th colspan='[length(command_positions)]'>Command Positions</th></tr><tr align='center'>"
|
||||
jobs += "<tr align='center' bgcolor='ccccff'><th colspan='[length(command_positions)]'><a href='?src=\ref[src];jobban3=commanddept;jobban4=\ref[M]'>Command Positions</a></th></tr><tr align='center'>"
|
||||
for(var/jobPos in command_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/job = job_master.GetJob(jobPos)
|
||||
@@ -152,7 +156,7 @@
|
||||
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=[job.title];jobban4=\ref[M]'>[dd_replacetext(job.title, " ", " ")]</a></td>"
|
||||
counter++
|
||||
|
||||
if(counter >= 5) //So things dont get squiiiiished!
|
||||
if(counter >= 6) //So things dont get squiiiiished!
|
||||
jobs += "</tr><tr>"
|
||||
counter = 0
|
||||
jobs += "</tr></table>"
|
||||
@@ -160,7 +164,7 @@
|
||||
//Security (Red)
|
||||
counter = 0
|
||||
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
|
||||
jobs += "<tr bgcolor='ffddf0'><th colspan='[length(security_positions)]'>Security Positions</th></tr><tr align='center'>"
|
||||
jobs += "<tr bgcolor='ffddf0'><th colspan='[length(security_positions)]'><a href='?src=\ref[src];jobban3=securitydept;jobban4=\ref[M]'>Security Positions</a></th></tr><tr align='center'>"
|
||||
for(var/jobPos in security_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/job = job_master.GetJob(jobPos)
|
||||
@@ -181,7 +185,7 @@
|
||||
//Engineering (Yellow)
|
||||
counter = 0
|
||||
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
|
||||
jobs += "<tr bgcolor='fff5cc'><th colspan='[length(engineering_positions)]'>Engineering Positions</th></tr><tr align='center'>"
|
||||
jobs += "<tr bgcolor='fff5cc'><th colspan='[length(engineering_positions)]'><a href='?src=\ref[src];jobban3=engineeringdept;jobban4=\ref[M]'>Engineering Positions</a></th></tr><tr align='center'>"
|
||||
for(var/jobPos in engineering_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/job = job_master.GetJob(jobPos)
|
||||
@@ -202,7 +206,7 @@
|
||||
//Medical (White)
|
||||
counter = 0
|
||||
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
|
||||
jobs += "<tr bgcolor='ffeef0'><th colspan='[length(medical_positions)]'>Medical Positions</th></tr><tr align='center'>"
|
||||
jobs += "<tr bgcolor='ffeef0'><th colspan='[length(medical_positions)]'><a href='?src=\ref[src];jobban3=medicaldept;jobban4=\ref[M]'>Medical Positions</a></th></tr><tr align='center'>"
|
||||
for(var/jobPos in medical_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/job = job_master.GetJob(jobPos)
|
||||
@@ -223,7 +227,7 @@
|
||||
//Science (Purple)
|
||||
counter = 0
|
||||
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
|
||||
jobs += "<tr bgcolor='e79fff'><th colspan='[length(science_positions)]'>Science Positions</th></tr><tr align='center'>"
|
||||
jobs += "<tr bgcolor='e79fff'><th colspan='[length(science_positions)]'><a href='?src=\ref[src];jobban3=sciencedept;jobban4=\ref[M]'>Science Positions</a></th></tr><tr align='center'>"
|
||||
for(var/jobPos in science_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/job = job_master.GetJob(jobPos)
|
||||
@@ -244,7 +248,7 @@
|
||||
//Civilian (Grey)
|
||||
counter = 0
|
||||
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
|
||||
jobs += "<tr bgcolor='dddddd'><th colspan='[length(civilian_positions)]'>Civilian Positions</th></tr><tr align='center'>"
|
||||
jobs += "<tr bgcolor='dddddd'><th colspan='[length(civilian_positions)]'><a href='?src=\ref[src];jobban3=civiliandept;jobban4=\ref[M]'>Civilian Positions</a></th></tr><tr align='center'>"
|
||||
for(var/jobPos in civilian_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/job = job_master.GetJob(jobPos)
|
||||
@@ -265,7 +269,7 @@
|
||||
//Non-Human (Green)
|
||||
counter = 0
|
||||
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
|
||||
jobs += "<tr bgcolor='ccffcc'><th colspan='[length(nonhuman_positions)]'>Non-human Positions</th></tr><tr align='center'>"
|
||||
jobs += "<tr bgcolor='ccffcc'><th colspan='[length(nonhuman_positions)]'><a href='?src=\ref[src];jobban3=nonhumandept;jobban4=\ref[M]'>Non-human Positions</a></th></tr><tr align='center'>"
|
||||
for(var/jobPos in nonhuman_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/job = job_master.GetJob(jobPos)
|
||||
@@ -291,109 +295,186 @@
|
||||
jobs += "</tr></table>"
|
||||
|
||||
//Antagonist (Orange)
|
||||
var/isbanned_dept = jobban_isbanned(M, "Syndicate")
|
||||
jobs += "<table cellpadding='1' cellspacing='0' width='100%'>"
|
||||
jobs += "<tr bgcolor='ffeeaa'><th colspan='10'>Antagonist Positions</th></tr><tr align='center'>"
|
||||
|
||||
//All antagonists
|
||||
if(jobban_isbanned(M, "Syndicate"))
|
||||
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=Syndicate;jobban4=\ref[M]'><font color=red>[dd_replacetext("All Antagonists", " ", " ")]</font></a></td>"
|
||||
else
|
||||
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=Syndicate;jobban4=\ref[M]'>[dd_replacetext("All Antagonists", " ", " ")]</a></td>"
|
||||
jobs += "<tr bgcolor='ffeeaa'><th colspan='10'><a href='?src=\ref[src];jobban3=Syndicate;jobban4=\ref[M]'>Antagonist Positions</a></th></tr><tr align='center'>"
|
||||
|
||||
//Traitor
|
||||
if(jobban_isbanned(M, "traitor") || jobban_isbanned(M, "Syndicate"))
|
||||
if(jobban_isbanned(M, "traitor") || isbanned_dept)
|
||||
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=traitor;jobban4=\ref[M]'><font color=red>[dd_replacetext("Traitor", " ", " ")]</font></a></td>"
|
||||
else
|
||||
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=traitor;jobban4=\ref[M]'>[dd_replacetext("Traitor", " ", " ")]</a></td>"
|
||||
|
||||
//Changeling
|
||||
if(jobban_isbanned(M, "changeling") || jobban_isbanned(M, "Syndicate"))
|
||||
if(jobban_isbanned(M, "changeling") || isbanned_dept)
|
||||
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=changeling;jobban4=\ref[M]'><font color=red>[dd_replacetext("Changeling", " ", " ")]</font></a></td>"
|
||||
else
|
||||
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=changeling;jobban4=\ref[M]'>[dd_replacetext("Changeling", " ", " ")]</a></td>"
|
||||
|
||||
//Nuke Operative
|
||||
if(jobban_isbanned(M, "operative") || jobban_isbanned(M, "Syndicate"))
|
||||
if(jobban_isbanned(M, "operative") || isbanned_dept)
|
||||
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=operative;jobban4=\ref[M]'><font color=red>[dd_replacetext("Nuke Operative", " ", " ")]</font></a></td>"
|
||||
else
|
||||
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=operative;jobban4=\ref[M]'>[dd_replacetext("Nuke Operative", " ", " ")]</a></td>"
|
||||
|
||||
//Revolutionary
|
||||
if(jobban_isbanned(M, "revolutionary") || jobban_isbanned(M, "Syndicate"))
|
||||
if(jobban_isbanned(M, "revolutionary") || isbanned_dept)
|
||||
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=revolutionary;jobban4=\ref[M]'><font color=red>[dd_replacetext("Revolutionary", " ", " ")]</font></a></td>"
|
||||
else
|
||||
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=revolutionary;jobban4=\ref[M]'>[dd_replacetext("Revolutionary", " ", " ")]</a></td>"
|
||||
|
||||
jobs += "</tr><tr align='center'>" //Breaking it up so it fits nicer on the screen every 5 entries
|
||||
|
||||
//Cultist
|
||||
if(jobban_isbanned(M, "Cultist") || jobban_isbanned(M, "Syndicate"))
|
||||
if(jobban_isbanned(M, "cultist") || isbanned_dept)
|
||||
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=cultist;jobban4=\ref[M]'><font color=red>[dd_replacetext("Cultist", " ", " ")]</font></a></td>"
|
||||
else
|
||||
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=cultist;jobban4=\ref[M]'>[dd_replacetext("Cultist", " ", " ")]</a></td>"
|
||||
|
||||
jobs += "</tr><tr align='center'>" //Breaking it up so it fits nicer on the screen every 5 entries
|
||||
|
||||
//Wizard
|
||||
if(jobban_isbanned(M, "wizard") || jobban_isbanned(M, "Syndicate"))
|
||||
if(jobban_isbanned(M, "wizard") || isbanned_dept)
|
||||
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=wizard;jobban4=\ref[M]'><font color=red>[dd_replacetext("Wizard", " ", " ")]</font></a></td>"
|
||||
else
|
||||
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=wizard;jobban4=\ref[M]'>[dd_replacetext("Wizard", " ", " ")]</a></td>"
|
||||
|
||||
//Malfunctioning AI
|
||||
if(jobban_isbanned(M, "malf AI") || jobban_isbanned(M, "Syndicate"))
|
||||
if(jobban_isbanned(M, "malf AI") || isbanned_dept)
|
||||
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=malf AI;jobban4=\ref[M]'><font color=red>[dd_replacetext("Malf AI", " ", " ")]</font></a></td>"
|
||||
else
|
||||
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=malf AI;jobban4=\ref[M]'>[dd_replacetext("Malf AI", " ", " ")]</a></td>"
|
||||
|
||||
//Alien
|
||||
if(jobban_isbanned(M, "alien candidate") || jobban_isbanned(M, "Syndicate"))
|
||||
if(jobban_isbanned(M, "alien candidate") || isbanned_dept)
|
||||
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=alien candidate;jobban4=\ref[M]'><font color=red>[dd_replacetext("Alien", " ", " ")]</font></a></td>"
|
||||
else
|
||||
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=alien candidate;jobban4=\ref[M]'>[dd_replacetext("Alien", " ", " ")]</a></td>"
|
||||
|
||||
//Infested Monkey
|
||||
if(jobban_isbanned(M, "infested monkey") || jobban_isbanned(M, "Syndicate"))
|
||||
if(jobban_isbanned(M, "infested monkey") || isbanned_dept)
|
||||
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=infested monkey;jobban4=\ref[M]'><font color=red>[dd_replacetext("Infested Monkey", " ", " ")]</font></a></td>"
|
||||
else
|
||||
jobs += "<td width='20%'><a href='?src=\ref[src];jobban3=infested monkey;jobban4=\ref[M]'>[dd_replacetext("Infested Monkey", " ", " ")]</a></td>"
|
||||
|
||||
jobs += "</tr></table>"
|
||||
|
||||
body = "<br>[jobs]<br><br>"
|
||||
body = "<body>[jobs]</body>"
|
||||
dat = "<tt>[header][body]</tt>"
|
||||
usr << browse(dat, "window=jobban2;size=800x400")
|
||||
usr << browse(dat, "window=jobban2;size=800x450")
|
||||
return
|
||||
|
||||
//JOBBAN'S INNARDS
|
||||
if(href_list["jobban3"])
|
||||
if (src.rank in list( "Admin Candidate", "Temporary Admin", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))
|
||||
var/mob/M = locate(href_list["jobban4"])
|
||||
var/job = href_list["jobban3"]
|
||||
if(!M)
|
||||
alert("Mob no longer exists!")
|
||||
return
|
||||
if ((M.client && M.client.holder && (M.client.holder.level > src.level)))
|
||||
alert("You cannot perform this action. You must be of a higher administrative rank!")
|
||||
return
|
||||
if (jobban_isbanned(M, job))
|
||||
log_admin("[key_name(usr)] unbanned [key_name(M)] from [job]")
|
||||
ban_unban_log_save("[key_name(usr)] unjobbanned [key_name(M)] from [job]")
|
||||
M << "\red<BIG><B>You have been un-jobbanned by [usr.client.ckey] from [job].</B></BIG>"
|
||||
feedback_inc("ban_job_unban",1)
|
||||
feedback_add_details("ban_job_unban","- [job]")
|
||||
message_admins("\blue [key_name_admin(usr)] unbanned [key_name_admin(M)] from [job]", 1)
|
||||
jobban_unban(M, job)
|
||||
href_list["jobban2"] = 1
|
||||
else
|
||||
var/reason = input(usr,"Reason?","reason","griefer") as text|null
|
||||
if(!reason)
|
||||
return
|
||||
ban_unban_log_save("[key_name(usr)] jobbanned [key_name(M)] from [job]. reason: [reason]")
|
||||
log_admin("[key_name(usr)] banned [key_name(M)] from [job]")
|
||||
feedback_inc("ban_job",1)
|
||||
feedback_add_details("ban_job","- [job]")
|
||||
M << "\red<BIG><B>You have been jobbanned by [usr.client.ckey] from [job].</B></BIG>"
|
||||
M << "\red <B>The reason is: [reason]</B>"
|
||||
M << "\red Jooban can be lifted only on demand."
|
||||
message_admins("\blue [key_name_admin(usr)] banned [key_name_admin(M)] from [job]", 1)
|
||||
jobban_fullban(M, job, reason)
|
||||
href_list["jobban2"] = 1 // lets it fall through and refresh
|
||||
if(!job_master)
|
||||
usr << "Job Master has not been setup!"
|
||||
return
|
||||
|
||||
//get jobs for department if specified, otherwise just returnt he one job in a list.
|
||||
var/list/joblist = list()
|
||||
switch(href_list["jobban3"])
|
||||
if("commanddept")
|
||||
for(var/jobPos in command_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/temp = job_master.GetJob(jobPos)
|
||||
if(!temp) continue
|
||||
joblist += temp.title
|
||||
if("securitydept")
|
||||
for(var/jobPos in security_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/temp = job_master.GetJob(jobPos)
|
||||
if(!temp) continue
|
||||
joblist += temp.title
|
||||
if("engineeringdept")
|
||||
for(var/jobPos in engineering_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/temp = job_master.GetJob(jobPos)
|
||||
if(!temp) continue
|
||||
joblist += temp.title
|
||||
if("medicaldept")
|
||||
for(var/jobPos in medical_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/temp = job_master.GetJob(jobPos)
|
||||
if(!temp) continue
|
||||
joblist += temp.title
|
||||
if("sciencedept")
|
||||
for(var/jobPos in science_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/temp = job_master.GetJob(jobPos)
|
||||
if(!temp) continue
|
||||
joblist += temp.title
|
||||
if("civiliandept")
|
||||
for(var/jobPos in civilian_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/temp = job_master.GetJob(jobPos)
|
||||
if(!temp) continue
|
||||
joblist += temp.title
|
||||
if("nonhumandept")
|
||||
joblist += "pAI"
|
||||
for(var/jobPos in nonhuman_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/temp = job_master.GetJob(jobPos)
|
||||
if(!temp) continue
|
||||
joblist += temp.title
|
||||
else
|
||||
joblist += href_list["jobban3"]
|
||||
|
||||
//Create a list of unbanned jobs within joblist
|
||||
var/list/notbannedlist = list()
|
||||
for(var/job in joblist)
|
||||
if(!jobban_isbanned(M, job))
|
||||
notbannedlist += job
|
||||
|
||||
//Banning comes first
|
||||
if(notbannedlist.len) //at least 1 unbanned job exists in joblist so we have stuff to ban.
|
||||
var/reason = input(usr,"Reason?","Please State Reason","") as text|null
|
||||
if(reason)
|
||||
var/msg
|
||||
for(var/job in notbannedlist)
|
||||
ban_unban_log_save("[key_name(usr)] jobbanned [key_name(M)] from [job]. reason: [reason]")
|
||||
log_admin("[key_name(usr)] banned [key_name(M)] from [job]")
|
||||
feedback_inc("ban_job",1)
|
||||
feedback_add_details("ban_job","- [job]")
|
||||
jobban_fullban(M, job, reason)
|
||||
if(!msg) msg = job
|
||||
else msg += ", [job]"
|
||||
message_admins("\blue [key_name_admin(usr)] banned [key_name_admin(M)] from [msg]", 1)
|
||||
M << "\red<BIG><B>You have been jobbanned by [usr.client.ckey] from: [msg].</B></BIG>"
|
||||
M << "\red <B>The reason is: [reason]</B>"
|
||||
M << "\red Jobban can be lifted only upon request."
|
||||
href_list["jobban2"] = 1 // lets it fall through and refresh
|
||||
return 1
|
||||
|
||||
//Unbanning joblist
|
||||
//all jobs in joblist are banned already OR we didn't give a reason (implying they shouldn't be banned)
|
||||
if(joblist.len) //at least 1 banned job exists in joblist so we have stuff to unban.
|
||||
var/msg
|
||||
for(var/job in joblist)
|
||||
var/reason = jobban_isbanned(M, job)
|
||||
if(!reason) continue //skip if it isn't jobbanned anyway
|
||||
switch(alert("Job: [job] Reason: '[reason]'. Are you sure you want to un-jobban?","Please Confirm","Yes","No"))
|
||||
if("Yes")
|
||||
ban_unban_log_save("[key_name(usr)] unjobbanned [key_name(M)] from [job]")
|
||||
log_admin("[key_name(usr)] unbanned [key_name(M)] from [job]")
|
||||
feedback_inc("ban_job_unban",1)
|
||||
feedback_add_details("ban_job_unban","- [job]")
|
||||
jobban_unban(M, job)
|
||||
if(!msg) msg = job
|
||||
else msg += ", [job]"
|
||||
else
|
||||
continue
|
||||
if(msg)
|
||||
message_admins("\blue [key_name_admin(usr)] unbanned [key_name_admin(M)] from [msg]", 1)
|
||||
M << "\red<BIG><B>You have been un-jobbanned by [usr.client.ckey] from [msg].</B></BIG>"
|
||||
href_list["jobban2"] = 1 // lets it fall through and refresh
|
||||
return 1
|
||||
return 0 //we didn't do anything!
|
||||
|
||||
if (href_list["boot2"])
|
||||
if ((src.rank in list( "Moderator", "Temporary Admin", "Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master" )))
|
||||
|
||||
@@ -3,7 +3,7 @@ var
|
||||
jobban_keylist[0] //to store the keys & ranks
|
||||
|
||||
/proc/jobban_fullban(mob/M, rank, reason)
|
||||
if (!M || !M.key || !M.client) return
|
||||
if (!M || !M.key) return
|
||||
jobban_keylist.Add(text("[M.ckey] - [rank] ## [reason]"))
|
||||
jobban_savebanfile()
|
||||
|
||||
@@ -23,7 +23,12 @@ var
|
||||
|
||||
for (var/s in jobban_keylist)
|
||||
if( findtext(s,"[M.ckey] - [rank]") )
|
||||
return 1
|
||||
var/startpos = findtext(s, "## ")+3
|
||||
if(startpos && startpos<length(s))
|
||||
var/text = copytext(s, startpos, 0)
|
||||
if(text)
|
||||
return text
|
||||
return "unknown"
|
||||
return 0
|
||||
|
||||
/*
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
if(CONSCIOUS)
|
||||
if(!src.client) msg += "It appears to be in stand-by mode.\n" //afk
|
||||
if(UNCONSCIOUS) msg += "<span class='warning'>It doesn't seem to be responding.</span>\n"
|
||||
if(DEAD) msg += "<span class='deadsay'>It appears to be powered-down.</span>\n"
|
||||
if(DEAD) msg += "<span class='deadsay'>It looks completely unsalvageable.</span>\n"
|
||||
msg += "*---------*</span>"
|
||||
|
||||
usr << msg
|
||||
|
||||
Reference in New Issue
Block a user