mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2025-12-29 11:41:14 +00:00
I have done lots of work to make selecting players for special roles be fair.
- New options preferences: "be traitor", "be changeling" and so on for all special roles.
- Now you can have job of AI/cyborg in preferences and do not lower your chances to become wizard/changeling/etc. And vice-versa: you do not have to select AI in your preferences to have non zero chance to play malf.
- Jobban from syndicate bans player from any special role (including malf AI, cult, etc).
- Fixed bug with changeling round not ending sometimes.
- All special roles were tuned to work better as admin-driven event.
-- All adminmade special characters will be listed at the end of round of any type.
-- All adminmade special characters are fully functional with following exceptions:
--- The ending conditions are determined at round start, i.e. you cannot end revolution by killing wizards and malf AIs (however, with nuke you can end anything).
--- The cultists cannot get their special objectives.
--- The malf AI can hack the APCs but without any profit.
--- The syndicate operatives must obtain the nuke/working code from admins.
--- As before, nuclear explosion ends round. Even if nuke was used in wrong place.
- Fixed thingy like "Not enough players for revolution game mode. Restarting world in 5 seconds."
- Changeling wont get objective "absorb X genomes" when there are less that X players in game.
- proc/equip_if_possible now has return value, procs like equip_revolutionary (giving a flash) should be more reliable.
- There are no fake wizards anymore. The research staff have to kill ALL wizards on order to win, even adminspawned ones. ("give spell" verb works as before, not making a spellcaster to actually be wizard).
- The semi-new game mode: traitor+changeling. Just like regular traitor mode plus one changeling. Round ends when the shuttle reaches centcom. Option for config.txt: "PROBABILITY TRAITORCHAN".
- Successful malf AI now have 60 seconds to choose to explode the station or not (some players still have to rejoin game to have their new verbs shown in Malfunction tab).
- Monkeys mode fixed, monkeys wouldn't randomly cure anymore.
For admins:
- New powerful mind editor oriented to mixed rounds.
-- Setting someone as special character (like wizard) does not equip him/her automatically. You have to do it it next step. Note, that in case of wizards and nuke operatives their old dress will be deleted! If you do not want it you shall use "undress" link.
-- Only operatives, head revs and cultists have their objectives set immediately.
-- You can unemad borgs!
-- You cannot unemag borgs because calling mind editor for nonhumans is blocked atm.
-- many other useful features.
-- you can fix burned out flashes from mind editor.
-- first assign the new malf AI/wizard then demalf/dewizard old one or round will immediately end.
- if delete the nuke bomb during its downcounting round will stuck. Using "edit ticker variables" set ticker.mode.explosion_in_progress = 0.
For coders:
- /datum/game_mode/malfunction/AI_Module renamed to /datum/AI_Module. Reason: What. The. Fuck.
Unrelated fixes:
- Blueprints can create areas up to 300 tiles (was 100).
- Cyborgs wont leave backpacks at spawn point anymore.
- Fixed bug in preferences causing preferences files to be huge.
- Diseases can infect again.
- The option "SQL_ENABLED 0" now works in config.txt.
- fixed critical bug on assassinate objective.
Bugs:
- We have a bug with job distribution for people who haven't any available jobs in their preferences. Players tends to group by jobs.
- For example, if we have 3 players they with hight chances will got same jobs. And probability of having one engineer and one medic _exactly_ equals _zero_.
- I am not sure if my changes made that bug worse. Anyway I MUST do this commit. Bug will be fixed eventually. Maybe.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1703 316c924e-a436-60f5-8080-3fe189b3f50e
267 lines
7.7 KiB
Plaintext
267 lines
7.7 KiB
Plaintext
/obj/item/blueprints
|
|
var/const/AREA_ERRNONE = 0
|
|
var/const/AREA_STATION = 1
|
|
var/const/AREA_SPACE = 2
|
|
var/const/AREA_SPECIAL = 3
|
|
|
|
var/const/BORDER_ERROR = 0
|
|
var/const/BORDER_NONE = 1
|
|
var/const/BORDER_BETWEEN = 2
|
|
var/const/BORDER_2NDTILE = 3
|
|
var/const/BORDER_SPACE = 4
|
|
|
|
var/const/ROOM_ERR_LOLWAT = 0
|
|
var/const/ROOM_ERR_SPACE = -1
|
|
var/const/ROOM_ERR_TOOLARGE = -2
|
|
|
|
/obj/item/blueprints/attack_self(mob/M as mob)
|
|
if (!istype(M,/mob/living/carbon/human))
|
|
M << "This is stack of useless pieces of harsh paper." //monkeys cannot into projecting
|
|
return
|
|
interact()
|
|
return
|
|
|
|
/obj/item/blueprints/Topic(href, href_list)
|
|
..()
|
|
if ((usr.restrained() || usr.stat || usr.equipped() != src))
|
|
return
|
|
if (!href_list["action"])
|
|
return
|
|
switch(href_list["action"])
|
|
if ("create_area")
|
|
if (get_area_type()!=AREA_SPACE)
|
|
interact()
|
|
return
|
|
create_area()
|
|
if ("edit_area")
|
|
if (get_area_type()!=AREA_STATION)
|
|
interact()
|
|
return
|
|
edit_area()
|
|
|
|
/obj/item/blueprints/proc/interact()
|
|
var/area/A = get_area()
|
|
var/text = {"<HTML><head><title>[src]</title></head><BODY>
|
|
<h2>[station_name()] blueprints</h2>
|
|
<small>Property of Nanotrasen. For heads of staff only. Store in high-secure storage.</small><hr>
|
|
"}
|
|
switch (get_area_type())
|
|
if (AREA_SPACE)
|
|
text += {"
|
|
<p>According this blueprints you are in <b>open space</b> now.</p>
|
|
<p><a href='?src=\ref[src];action=create_area'>Mark this place as new area.</a></p>
|
|
"}
|
|
if (AREA_STATION)
|
|
text += {"
|
|
<p>According this blueprints you are in <b>[A.name]</b> now.</p>
|
|
<p>You may <a href='?src=\ref[src];action=edit_area'>
|
|
move an amendment</a> to the drawing.</p>
|
|
"}
|
|
if (AREA_SPECIAL)
|
|
text += {"
|
|
<p>This place doesn't noted on this blueprints.</p>
|
|
"}
|
|
else
|
|
return
|
|
text += "</BODY></HTML>"
|
|
usr << browse(text, "window=blueprints")
|
|
onclose(usr, "blueprints")
|
|
|
|
|
|
/obj/item/blueprints/proc/get_area()
|
|
var/turf/T = get_turf_loc(usr)
|
|
var/area/A = T.loc
|
|
A = A.master
|
|
return A
|
|
|
|
/obj/item/blueprints/proc/get_area_type(var/area/A = get_area())
|
|
if (A.name == "Space")
|
|
return AREA_SPACE
|
|
var/list/SPECIALS = list(
|
|
/area/shuttle,
|
|
/area/admin,
|
|
/area/arrival,
|
|
/area/centcom,
|
|
/area/asteroid,
|
|
/area/tdome,
|
|
/area/syndicate_station,
|
|
/area/wizard_station,
|
|
/area/prison
|
|
// /area/derelict //commented out, all hail derelict-rebuilders!
|
|
)
|
|
for (var/type in SPECIALS)
|
|
if ( istype(A,type) )
|
|
return AREA_SPECIAL
|
|
return AREA_STATION
|
|
|
|
/obj/item/blueprints/proc/create_area()
|
|
//world << "DEBUG: create_area"
|
|
var/res = detect_room(get_turf_loc(usr))
|
|
if(!istype(res,/list))
|
|
switch(res)
|
|
if(ROOM_ERR_SPACE)
|
|
usr << "\red New area must be complete airtight!"
|
|
return
|
|
if(ROOM_ERR_TOOLARGE)
|
|
usr << "\red New area too large!"
|
|
return
|
|
else
|
|
usr << "\red Error! Please notify administration!"
|
|
return
|
|
var/list/turf/turfs = res
|
|
var/str = sanitize(trim(input(usr,"New area title","Blueprints editing")))
|
|
if(!str || !length(str)) //cancel
|
|
return
|
|
if(length(str) > 50)
|
|
usr << "\red Text too long."
|
|
return
|
|
var/area/A = new
|
|
A.name = str
|
|
A.tag="[A.type]_[md5(str)]" // without this dynamic light system ruin everithing
|
|
//var/ma
|
|
//ma = A.master ? "[A.master]" : "(null)"
|
|
//world << "DEBUG: create_area: <br>A.name=[A.name]<br>A.tag=[A.tag]<br>A.master=[ma]"
|
|
A.power_equip = 0
|
|
A.power_light = 0
|
|
A.power_environ = 0
|
|
move_turfs_to_area(turfs, A)
|
|
spawn(5)
|
|
//ma = A.master ? "[A.master]" : "(null)"
|
|
//world << "DEBUG: create_area(5): <br>A.name=[A.name]<br>A.tag=[A.tag]<br>A.master=[ma]"
|
|
interact()
|
|
return
|
|
|
|
|
|
/obj/item/blueprints/proc/move_turfs_to_area(var/list/turf/turfs, var/area/A)
|
|
A.contents.Add(turfs)
|
|
//oldarea.contents.Remove(usr.loc) // not needed
|
|
//T.loc = A //error: cannot change constant value
|
|
|
|
|
|
/obj/item/blueprints/proc/edit_area()
|
|
var/area/A = get_area()
|
|
//world << "DEBUG: edit_area"
|
|
var/prevname = A.name
|
|
var/str = sanitize(trim(input(usr,"New area title","Blueprints editing",prevname)))
|
|
if(!str || !length(str) || str==prevname) //cancel
|
|
return
|
|
if(length(str) > 50)
|
|
usr << "\red Text too long."
|
|
return
|
|
set_area_machinery_title(A,str,prevname)
|
|
for(var/area/RA in A.related)
|
|
RA.name = str
|
|
usr << "\blue You set the area '[prevname]' title to '[str]'."
|
|
interact()
|
|
return
|
|
|
|
|
|
|
|
/obj/item/blueprints/proc/set_area_machinery_title(var/area/A,var/title,var/oldtitle)
|
|
if (!oldtitle) // or dd_replacetext goes to infinite loop
|
|
return
|
|
for(var/area/RA in A.related)
|
|
for(var/obj/machinery/alarm/M in RA)
|
|
M.name = dd_replacetext(M.name,oldtitle,title)
|
|
for(var/obj/machinery/power/apc/M in RA)
|
|
M.name = dd_replacetext(M.name,oldtitle,title)
|
|
for(var/obj/machinery/atmospherics/unary/vent_scrubber/M in RA)
|
|
M.name = dd_replacetext(M.name,oldtitle,title)
|
|
for(var/obj/machinery/atmospherics/unary/vent_pump/M in RA)
|
|
M.name = dd_replacetext(M.name,oldtitle,title)
|
|
for(var/obj/machinery/door/M in RA)
|
|
M.name = dd_replacetext(M.name,oldtitle,title)
|
|
//TODO: much much more. Unnamed airlocks, cameras, etc.
|
|
|
|
/obj/item/blueprints/proc/check_tile_is_border(var/turf/T2,var/dir)
|
|
if (istype(T2, /turf/space))
|
|
return BORDER_SPACE //omg hull breach we all going to die here
|
|
if (istype(T2, /turf/simulated/shuttle))
|
|
return BORDER_SPACE
|
|
if (get_area_type(T2.loc)!=AREA_SPACE)
|
|
return BORDER_BETWEEN
|
|
if (istype(T2, /turf/simulated/wall))
|
|
return BORDER_2NDTILE
|
|
if (!istype(T2, /turf/simulated))
|
|
return BORDER_BETWEEN
|
|
|
|
for (var/obj/window/W in T2)
|
|
if(turn(dir,180) == W.dir)
|
|
return BORDER_BETWEEN
|
|
if (W.dir in list(NORTHEAST,SOUTHEAST,NORTHWEST,SOUTHWEST))
|
|
return BORDER_2NDTILE
|
|
for(var/obj/machinery/door/window/D in T2)
|
|
if(turn(dir,180) == D.dir)
|
|
return BORDER_BETWEEN
|
|
if (locate(/obj/machinery/door) in T2)
|
|
return BORDER_2NDTILE
|
|
if (locate(/obj/falsewall) in T2)
|
|
return BORDER_2NDTILE
|
|
if (locate(/obj/falserwall) in T2)
|
|
return BORDER_2NDTILE
|
|
|
|
return BORDER_NONE
|
|
|
|
/obj/item/blueprints/proc/detect_room(var/turf/first)
|
|
var/list/turf/found = new
|
|
var/list/turf/pending = list(first)
|
|
while(pending.len)
|
|
if (found.len+pending.len > 300)
|
|
return ROOM_ERR_TOOLARGE
|
|
var/turf/T = pending[1] //why byond havent list::pop()?
|
|
pending -= T
|
|
for (var/dir in cardinal)
|
|
var/skip = 0
|
|
for (var/obj/window/W in T)
|
|
if(dir == W.dir || (W.dir in list(NORTHEAST,SOUTHEAST,NORTHWEST,SOUTHWEST)))
|
|
skip = 1; break
|
|
if (skip) continue
|
|
for(var/obj/machinery/door/window/D in T)
|
|
if(dir == D.dir)
|
|
skip = 1; break
|
|
if (skip) continue
|
|
|
|
var/turf/NT = get_step(T,dir)
|
|
if (!isturf(NT) || (NT in found) || (NT in pending))
|
|
continue
|
|
|
|
switch(check_tile_is_border(NT,dir))
|
|
if(BORDER_NONE)
|
|
pending+=NT
|
|
if(BORDER_BETWEEN)
|
|
//do nothing, may be later i'll add 'rejected' list as optimization
|
|
if(BORDER_2NDTILE)
|
|
found+=NT //tile included to new area, but we dont seek more
|
|
if(BORDER_SPACE)
|
|
return ROOM_ERR_SPACE
|
|
found+=T
|
|
return found
|
|
|
|
/*
|
|
/proc/check_apc(var/area/A)
|
|
for(var/area/RA in A.related)
|
|
for(var/obj/machinery/power/apc/FINDME in RA)
|
|
return 1
|
|
return 0
|
|
|
|
/proc/fuckingfreemachinery()
|
|
for(var/obj/machinery/machine in machines)
|
|
if (istype(machine,/obj/machinery/power/solar))
|
|
continue
|
|
var/area/A = machine.loc.loc // make sure it's in an area
|
|
if (istype(A,/area/tdome))
|
|
continue
|
|
if (istype(A,/area/shuttle))
|
|
continue
|
|
if(!A || !isarea(A))
|
|
world << "DEBUG: @[machine.x],[machine.y],[machine.z] ([A.name]) machine \"[machine.name]\" ([machine.type]) hasnt area!"
|
|
continue
|
|
A = A.master
|
|
if (A.name=="Space")
|
|
world << "DEBUG: @[machine.x],[machine.y],[machine.z] ([A.name]) machine \"[machine.name]\" ([machine.type]) work in space!"
|
|
continue
|
|
if (!check_apc(A))
|
|
world << "DEBUG: @[machine.x],[machine.y],[machine.z] ([A.name]) machine \"[machine.name]\" ([machine.type]) work without APC!"
|
|
world << "\red END ====="
|
|
|
|
*/ |