mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 02:16:05 +00:00
* [ci skip] Automatic changelog update. * Beretta action: Electric boogaloo (#18362) * Beretta action: Electric boogaloo First part of a three PRs to make a new traitor bundle centered around akimbo pistols. This PR adds the Beretta 92FS to the game, holding 15 9mm rounds per magazine. In addition, the Beretta 92FS is also added to the Summon Guns list for Wizards. :CL: *rsadd: Adds the Beretta 92FS. Kong whiskey not included. * Forgot to add the summon guns change for Berettas. * fuggin pushes destroying MAH CODE * Huh yeah, my copy-pasta skills are getting worse by the day. * Restores PKA charge indicator (#18369) * Restored PKA charge indicator * Updated var name * Player preferences can be edited during server start-up (#18352) * Player preferences can be edited during server start-up * Better safe than sorry * Unit testing (#18329) * Unit testing * Fixes * [ci skip] Automatic changelog update. * Doppelganger tweaks/nerfs (#18353) * Doppelganger tweaks/nerfs * Oof * Oof ! (bis) * [ci skip] Automatic changelog update. * [ci skip] Automatic changelog update. * Unbind the O key in hotkeymode so it can be used for macros (#18395) * Noreact spray bottle (#18367) * Adds the noreact spray bottle. Doesn't react straight away, slightly longer travel time * adds sprite * fixes adminordrazine (#18399) * No-client messages for shades and constructs (#18401) * No-client messages for shades and constructs * No reason to repeat the name * [ci skip] Automatic changelog update. * Fail compilation with an error message if version is <512 (#18403) * Request consoles notify user when their text is invalid (#18408) * Fixed cult armor so it's wearable again (#18410) * [ci skip] Automatic changelog update. * Every day's a good day when you paint (#18351) * Every day's a good day when you paint * Let's paint some happy little trees right here * Windows can now be rotated with alt-click. (#18268) * Windows can now be rotated with alt-click. * Re-adds fullwindow alt-click functionality. * [ci skip] Automatic changelog update. * Flashbangs on your tile ignore protection (#18375) * [ci skip] Automatic changelog update. * Corrects some of the IC dead checks to use the isDead macro (#18377) * Fixed apiary/attackby runtime (#18417) * Fixed bugged revive() regarding restraints (#18428) * [ci skip] Automatic changelog update. * Constructs and shades attackby fixes (#18422) * [ci skip] Automatic changelog update. * adds control datums, so you can control multiple things at once. (#18366) * adds control datums, so you can control multiple things at once. * moves the defines to a _DEFINE file * Fixed revivecounter runtimes (#18421) * Drugs that remove hallucination are 3x as effective while sleeping, 2x as effective while resting (#18398) * [ci skip] Automatic changelog update. * Interesting Crafting (#17540) * Adds material inheritance to created objects, fleshes out material datums a bit * adds description generator and quality generator * converts qualityToString from a proc to a list by index * removes \a macros as they would cause a JS error * adds the mat_type variable to sheets, which holds the material type define that they represent. DO NOT MISUSE, or do, I'm not the law. * instead of multiple different variables holding a sheet type, objects now uses a standardized sheet type variable * removes doubleratchet * tweaks descriptions some more. Things made via dorf stack recipes now inherit the materials sheet type when deconstructed * calling the parent matters now * I was only given the one fixyourshitnigger, I feel ripped off * buffs the cost of dorf recipes * fixes pointed out things * [ci skip] Automatic changelog update. * Adds the grease spell, spell aspect flags (#18373) * Adds the grease spell, summoning forth grease (lube) either from your immediate location, or in an area in proximity to yourself * adds spell aspect flags, for spell congruency. Moves most of the spell defines to their own file, rather than being littered everywhere. * [ci skip] Automatic changelog update. * Updated mob resetVariables() (#18447) * [ci skip] Automatic changelog update. * Fixed uranium chair to diamond transmutation (#18449) * Bee resetVariables() (#18448) * Camera to blinder fixes (#18441) * Camera to blinder fixes * Now with fewer unnecessary bulbs created * Got rid of bulb double negative * Special cam to blinder continuity * Fixed runtime, split decon list into separate vars * [ci skip] Automatic changelog update. * Updated helmet coverage flags (#18412) * [ci skip] Automatic changelog update. * Adds a robot maintenance crate to cargo (#18389) * Adds a robot maintenance crate to cargo * crate * Tweaks because slimes is a crying homo * [ci skip] Automatic changelog update. * Cyborgs cover unlock on death (#18414) * Adds a robot maintenance crate to cargo * Makes cyborg covers unlock on death * Revert "Adds a robot maintenance crate to cargo" This reverts commitbecf044207. * [ci skip] Automatic changelog update. * fixes some of the mobs I added for halloween that just weren't working right. (#18419) * Relish and mustard condiments. (#18420) * [ci skip] Automatic changelog update. * Fixes vanishing cyborg cells (#18425) * Passing var names this time (#18450) * Stray white pixel on sawn-off shotgun in-hand (#18451) * if(x.type in typesof()) -> istype() (#18453) * if(x in typesof()) -> istype() * 100% tested * Fixed preferenecs formatting (#18455) * Moved character records settings under the character-specific prefs (#18454) * Fixed AI-eye runtime (#18456) * [ci skip] Automatic changelog update. * Player-minebot improvements (#18452) * Humanize resets default language (#18464) * [ci skip] Automatic changelog update. * Fixed covering your face and body not preventing examine() from determining your gender (#18466) * Defib burn husks again (#18463) * tick tock goes the clock (#18426) * tick tock goes the clock * removes capitals * [ci skip] Automatic changelog update. * Sokoban vault (#18432) * Sokoban [WIP] * Rewards? * Forgot this one * Hmm did i fuck anything up by this * Adds entrance * Actually I was wrong again lol * That's it for today * Better cheating tracking, LORE * Buff the vest of reflection, exclude it from spessmart * [ci skip] Automatic changelog update. * Fixed gibtonite item not exploding (#18469) * [ci skip] Automatic changelog update. * All code changed here is comedy gold (#18470) * Adds syndie tape for sec, atmos, and engineering. (#18227) * Adds Syndie Tape * I'm dumb as bricks * return standardisation * [ci skip] Automatic changelog update. * Fixed goonchat crash when opening 'save chat logs' (#18477) * Stole some vending machine animations from Bay (#18476) * Stole some vending machine animations from Bay * vend_delay * [ci skip] Automatic changelog update. * Clean up goonchat (#18478) * Fixed health scanner runtime (#18380) * Adds More Shit To Autolathes. (#18328) * Boop * More * Beartraps more expensive. * Axes the axes. Same for the sprays. * Radio messages no longer show the icon of the radio used to send them (#18370) * [ci skip] Automatic changelog update. * [ci skip] Automatic changelog update. * Fixed spells runtime (#17815) * Can now add robotic heads to the body (#18430) * Can now add robotic heads to the body * Can now put organs in those robotic heads * Fixes Molotov logging and bottles breaking (#18481) Actually does NOT fix Molotovs breaking, due to a BYOND bug, but if that bug gets fixed then it will * Staff of Change bolts don't wipe wizard spells (#18461) * Fixed #9955 * Default language isn't carried over from the old mob * Splitting off languages part of this * [ci skip] Automatic changelog update. * collectible kitty ears are back to being permanently black (#18485) * collectible kitty ears are back to being permanently black * indentation was off * Fixed runtime handler configuration runtimes (#18488) * [ci skip] Automatic changelog update. * Adds untable mutagen. (#18212) * [ci skip] Automatic changelog update. * Shift-MMB on things at a distance makes you point at them. (#18487) * alt-click on things at a distance makes you point at them. * Replace mmb swaphands with point, remove altclick point. * Now mmb+shift * [ci skip] Automatic changelog update. * Action Button Runtime Hunt Episode 7: Runtimes die in magma! (#18446) * Action Button Runtime Hunt Episode 6: Runtimes will never die! * Wrong stick * I'M NOT CRAZY * I'M LITERALLY GRASPING AT STRAWS * Removes screwy power (#18493) * Removed screwy power * Non-computer machines must check power too * [ci skip] Automatic changelog update. * Enables ghost pointing (#18489) * Enabled ghost pointing * Visibility sanity for pointed_at() in wolves * [ci skip] Automatic changelog update. * Removed areaMaster (#18459) * reverted the change that made cat ears give brain damage (#18486) * [ci skip] Automatic changelog update. * Reverted the new dizziness (#18498) * [ci skip] Automatic changelog update. * Removes the anti-tamper device from the Tactical Assault Gear crate that can be ordered from Cargo. (#18483) As previous mentioned in this issue, considering that no other cargo crate does this and the fact that Pomf presumably said one time that crates and lockboxes shouldn't be booby-trapped (I don't have a log for that claim, so take it with a grain of salt), I and others believe that cargonians (and other folks) shouldn't have the content of the TACTICOOL ASSAULT GEAR crate get dissolved bya blend of sulphuric acid smoke and capsaicin because they decided to very illegally bust it open for very legitimate reasons. :CL: *tweak: NT decided to cut their budget allocation for anti-tampering device for the Tactical Assault Gear crate, * [ci skip] Automatic changelog update. * Updated HoP preview in character prefs (#18511) * Adds sanity to most cyborg/mommi verbs (#18415) * Adds sanity to most cyborg/mommi verbs * oops * oops 2 * oops 3 * tweaks to make things less hellish * actually, fuck mommis * not needed after all * getting unpowered removes your god dang map * tweaks * returns * reverse stormtrooper gear descriptions (#18516) * lets syndietape fit in belts (#18514) * [ci skip] Automatic changelog update. * Stops testing() abuse (#18504) * Inhaler immulsions (#18520) * Fixed blueprints just not working (#18521) * Fixed blueprints just not working * oops * Moves gun calibers to defines (#18427) * Moves gun calibers to defines * changes shotgun shell and flare defines to 12 guage and flare guage * Update weapons.dm * Give handteles a destination select alt-click, make attackself automa… (#18244) * Give handteles a destination select alt-click, make attackself automatically open a portal to the last destination. * Sanity revisions. * Handtele sanity. * [ci skip] Automatic changelog update. * Fixed a bug that made NT default silicons validhunting shitters (#18467) * Fixed a bug that made NT default silicons validhunting shitters * E V A L U A T E * Re-evaluate * [ci skip] Automatic changelog update. * Fixed rune activation html (#18522) * Removes stupid shit from wonderful wardrobe. (#18501) * Remove stone mask, transmog masks, and holochips from wonderful wardrobe. * Remove time suit and warping claws too. * Fixes a goof in Jewvend's New() (#18528) * Redid blinder fixes (#18482) * allows grenadelauncher on armor suit slot (#18515) * [ci skip] Automatic changelog update. * Make night-vision goggles less green. (#18496) * [ci skip] Automatic changelog update. * :byond: (#18494) * Basic way to eject things from transit tube pods (#18519) * Added ejecting to transit tube pods * List of pod contents when pod is entered, attack_robot(), and no unloading ghosts * So ghosts don't make this print an empty list * Have to declare others as a list * Unload to the front of the pod station * Limit on tube pod unloading * Moved listing of pod occupants to examine() * [ci skip] Automatic changelog update. * adds more guns to summon guns (#18518) * adds more guns to summon guns * stunrevolver * [ci skip] Automatic changelog update. * Adds sanity to fabricator process (#18539) * decoy balloons can now be bopped or popped by simple animals (#18535) * I have to check if a weapon is passed on attackby() because doors are retarded (#18541) * Fixed medbay vending machine turning blue (#18550) * Make resin doors take damage from lasers and bullets. (#18553) * Make resin doors take damage from lasers and bullets. * Remove a return. * [ci skip] Automatic changelog update. * Adds an in-hand sprite for Salem (#18545) *Adds a in-hand sprite for Salem *Fixes Salem turning into Runtime when picked up * [ci skip] Automatic changelog update. * literally replaces R&D with Tetris and clearing a line gives you a random research point (#18555) * [ci skip] Automatic changelog update. * Revert "literally replaces R&D with Tetris and clearing a line gives you a random research point" (#18558) * Revert "[ci skip] Automatic changelog update." This reverts commitbf396be340. * Revert "literally replaces R&D with Tetris and clearing a line gives you a random research point (#18555)" This reverts commit91cb6d94e4. * Added bees to unsafe mobs (#18562) * Make buckshot spread independent of the distance you click at. (#18543) * Current progress * Make buckshot spread independent of where you click on the screen. * [ci skip] Automatic changelog update. * Asthma can't be a roundstart random mutation anymore (#18568) * Lazily fixes mommi holomaps fucking up (#18564) * Make dark gygax overload stop making it invisible (#18567) * [ci skip] Automatic changelog update. * Show silicon ckeys at roundend even if they ghost. (#18534) * Show silicon ckeys at roundend even if they ghost. * Move get_key to unsorted.dm * Remove a blank line * [ci skip] Automatic changelog update. * punk's not quite dead, but a little rare (#18433) * punk is dead * punks almost dead * Can now create vampires through the create antagonists button (#18538) * winter spellbook (#18536) * [ci skip] Automatic changelog update. * Fixes an illegal area in the hallway (#18577) * Added 'Does Not Tip' backdoor traitor item (#18523) * Added 'Does Not Tip' backdoor traitor item * Actually implement the thing * meh * unga bunga * derp derp * [ci skip] Automatic changelog update. * Added a progress bar to the benomorph evolve spell (#18582) * Fixed species-specific spells removal (#18585) * In-hands for training swords (#18581) * [ci skip] Automatic changelog update. * Make malf law not state html to chat, make all law zeroes appear red. (#18570) * Adds thumbs.db to .gitignore (#18597) * Adds .code-workspace to .gitignore (#18598) * Fixed defib in-hands (#18586) * [ci skip] Automatic changelog update. * while hallucinating, chance your coworkers may look like a hostile mob (#18423) * while hallucinating, chance your coworkers may look like a hostile mob * hallucination and adminwarns * gotta initialize * can now fit a pai to a minebot (#18434) * [ci skip] Automatic changelog update. * Balances the masks of transmogriphication (#18205) * Masks take 5 seconds to put on Can no longer become boss mobs through the blank mask. * formatting preferences, and more to the blacklist * No more becoming hitler through mask use * [ci skip] Automatic changelog update. * Can now repair spacepods (#18540) * [ci skip] Automatic changelog update. * Buckshot tweaks. (#18571) * Current progress * Make buckshot spread independent of where you click on the screen. * Remove unused function, tweak bulletstorm * Fix various syntactic problems (#18604) * Horror form fixes, part 1 (#18584) * Horror form fixes, part 1 * Fixed horror form costing 0 chems * [ci skip] Automatic changelog update. * Beekeeping 3.6 (#18592) * Beekeeping 3.6 * qsdqsd * qdqsdq * grammar * [ci skip] Automatic changelog update. * Turns out you can't preallocate associative lists (#18606) * Turns out you can't preallocate associative lists * consistency * Friendly Fire 2: NT Boogaloo (#18607) With the advent of security getting an RPG in their armory's secure locker, NT isn't free from the joys of friendly fire and collateral damage. Please don't bully. * [ci skip] Automatic changelog update. * remove_air() (#18593) * Friendly Fire 3: NT with a vengeance. (#18615) * Revert "remove_air() (#18593)" This reverts commit18167fff6b. * Revert "[ci skip] Automatic changelog update." This reverts commit2983acce13. * Revert "Friendly Fire 2: NT Boogaloo (#18607)" This reverts commit0507bed40e. * [ci skip] Automatic changelog update. * Stops testing() abuse ACT2 (#18549) * Stops testing() abuse ACT2 * Easy weird trick. * Robots can lift tape (#18605) * Robots can lift tape * Whoops, forgot how MoMMIs work. MoMMIs are now unaffected. * [ci skip] Automatic changelog update. * Weighted voting with a threshold (#18560) * Weighted voting with a threshold * Reset discarded_choices * Atmos analyzers get air from the user's location instead of the turf (#18611) * Atmos analyzers get air from the user's location instead of the turf * Check to see if we need a unit volume * Fixed null environment runtimes * [ci skip] Automatic changelog update. * Makes the disability unit test pass (#18618) * Fixed 2 warnings caused by #18549 (#18616) * Unit test for disability datums (#18617) * Fixed atmos analyzer temperature range (#18620) * [ci skip] Automatic changelog update. * Fixed runtime in syndie atmos tape, plus message fixes (#18608) * Ethnic cleansing (#18619) * Remove duplicate defs; rename one def; fix some stray typos (#18599) * Remove duplicate defs * Fix more typos, re-add ED209 defs * Move damage defines to the same spot * okay actually re-add ED209 defs * Fix damage layer runtime (#18626) * Gripper transparent examining (#18629) * [ci skip] Automatic changelog update. * doors made less insane (#18542) * why why * whoops, broke doors. Thanks for catching that. * good catches all round * A scream was heard across the land. The coder had found the forbidden spaghetti. * It echoed across the rooftops, through the forest, and across the sea. * It went unheeded, as they were not the only one to be screaming. * Gripper two-mode dropping (#18627) * [ci skip] Automatic changelog update. * adds anvils (#18600) * adds anvils * Takes a lot of airflow to move an anvil. * let's not go the casual way about this. * [ci skip] Automatic changelog update. * Beekeeping 3.6.1 (#18621) * more beekeeping * sqdqs * better * Ports colorful reagent from TG. (#18492) * Adds colorful reagent. Mescaline psilocybin amatoxin. * Not implementing that shit yet. * Make bleach remove weird colours from items, turfs, mobs. * Remove tab. * [ci skip] Automatic changelog update. * fixing some dumb runtime (#18632) * Fixed runtime in gripper drop_item() (#18635) * Fixed MoMMIs not being able to pick up their modules (#18636) * [ci skip] Automatic changelog update. * Fixes a good in human overlay code (#18631) * Made EMPs instant(?) (#18602) * fixes confusion with the pizza traitor thing (#18655) * Changes the Albuteol (athsma medication) recipe. (#18588) * Adds Magmaws (#18630) * Adds the magmaw. They like to eat plasma. * adds the magmaw to the roid. Makes them not burn themselves apart. They now resurrect if blasted by fire. * mobs of the roid, destroy these invaders! * [ci skip] Automatic changelog update. * Timestamp med and sec records with the in-game time (#18658) * [ci skip] Automatic changelog update. * Albuterol is made with HYPERZONE, not INAPROVALINE (#18661) In other news, everybody followed Shifty's blindness and didn't notice that he swapped the Albuterol recipe to use Inaprovaline instead of Hyperzine. * [ci skip] Automatic changelog update. * Records give seconds again (#18660) * Door fixes (#18669) removes redundant is allowed check on windoors, that would prevent you emagging them unless you already had access to them. Tweaks the allowed check on blast doors, so you can't open them by hand, and bots can't bump them open. * magmaw fixes (#18670) * magmaw fixes magmaw now revive when set on fire through plasmafire magmaw death animation now plays properly. * adds the fire_resurrect proc * RIGGEDsky (#18663) * [ci skip] Automatic changelog update. * General Security-related mapping improvements. (#18594) * Changes the Albuteol (athsma medication) recipe. * General Security-related mapping improvements. * Fix compile, half-fix smartglass * Reeeee English - 1 * Reeee English - 2 * Reee English - 3 * [ci skip] Automatic changelog update. * Fixed robot clown stamp (#18675) * [ci skip] Automatic changelog update. * its (#18694) * Office chairs for chemistry (#18624) * Office chairs for chemistry * fugging dreammaker * fugging dreammaker * fugging dreammaker * Added separate attack verbs for lit and unlit states in matches, lighters, and cigarettes to fix issue #18572 (#18666) * Fixed issue 18572 by adding seperate attack verbs for lit and unlit states in cigarretes, lighters, and matches. * Made the variable declarations more consistent. * Quantity selection for making changelings and vampires (#18673) * [ci skip] Automatic changelog update. * Can now attack pods (#18689) Can now attack pods Adds an obj-level on_attack proc, for when you hit a thing with an object. Holds the attack_delay adjustment for the user, the attack animation, the hitsound, and the material on_hit. * Flashbang tweaks. (#18513) * Flashbang tweaks. * Lower the stun cap from 4 to 2, makes it more progressive. * Dumbass * [ci skip] Automatic changelog update. * glock mag fix (#18703) * [ci skip] Automatic changelog update. * Fixed backwards borg holomap sanity (#18707) * [ci skip] Automatic changelog update. * Fixes
422 lines
15 KiB
Plaintext
422 lines
15 KiB
Plaintext
var/global/randomize_laws = 0 // Not right now - N3X
|
|
var/global/base_law_type = /datum/ai_laws/asimov //Deinitialize this variable by commenting out Asimov as the base_law_type to activate AI lawset randomization
|
|
var/global/list/mommi_laws = list(
|
|
"Default" = /datum/ai_laws/keeper, // Asimov is OP as fuck on MoMMIs. - N3X
|
|
"Gravekeeper" = /datum/ai_laws/gravekeeper)
|
|
|
|
//Create proc for determining the lawset of the first silicon
|
|
//So long as base_law_type is declared, but uninitialized, the first silicon created in a round will randomly select a base_law_type based upon the below proc
|
|
//All silicons created during the round will start with the randomized base_law_type
|
|
//Weights are currently set to 40% Asimov, 20% Corporate, 20% NT Default, 10% Robocop, 10% Paladin
|
|
//Add, comment out, or adjust weights to modify law selection
|
|
//So long as the weights come to a sum of 100 total, they will be equal parts of 100%
|
|
/proc/getLawset(var/mob/M)
|
|
if(isMoMMI(M))
|
|
var/mob/living/silicon/robot/mommi/MM = M
|
|
var/obj/item/weapon/robot_module/mommi/mommimodule = MM.module
|
|
var/new_laws
|
|
if(!mommimodule || !mommi_laws[mommimodule.law_type])
|
|
new_laws = mommi_laws["Default"]
|
|
else
|
|
new_laws = mommi_laws[mommimodule.law_type]
|
|
return (new new_laws)
|
|
if(!base_law_type)
|
|
base_law_type = pick(
|
|
30;/datum/ai_laws/asimov,
|
|
20;/datum/ai_laws/corporate,
|
|
20;/datum/ai_laws/nanotrasen,
|
|
10;/datum/ai_laws/robocop,
|
|
10;/datum/ai_laws/paladin,
|
|
10;/datum/ai_laws/lazymov
|
|
)
|
|
return (new base_law_type) //Return the chosen lawset
|
|
|
|
// Used for the refactored law modules.
|
|
#define LAW_IONIC -2
|
|
#define LAW_INHERENT -1
|
|
#define LAW_ZERO 0
|
|
|
|
/datum/ai_laws
|
|
var/name = "Unknown Laws"
|
|
var/randomly_selectable = 0
|
|
// Zeroth laws
|
|
var/zeroth = null
|
|
var/zeroth_borg = null // wotm8
|
|
var/list/inherent = list()
|
|
var/list/supplied = list()
|
|
var/list/ion = list()
|
|
|
|
// Used in planning frames.
|
|
var/inherent_cleared = 0
|
|
|
|
/* General ai_law functions */
|
|
|
|
/datum/ai_laws/proc/set_zeroth_law(var/law, var/law_borg = null)
|
|
src.zeroth = law
|
|
if(law_borg) //Making it possible for slaved borgs to see a different law 0 than their AI. --NEO
|
|
src.zeroth_borg = law_borg
|
|
|
|
/datum/ai_laws/proc/add_inherent_law(var/law)
|
|
if (!(law in src.inherent))
|
|
src.inherent += law
|
|
|
|
/datum/ai_laws/proc/add_ion_law(var/law)
|
|
src.ion += law
|
|
|
|
/datum/ai_laws/proc/clear_inherent_laws()
|
|
del(src.inherent)
|
|
src.inherent = list()
|
|
inherent_cleared = 1
|
|
|
|
/datum/ai_laws/proc/add_supplied_law(var/number, var/law)
|
|
while (src.supplied.len < number + 1)
|
|
src.supplied += ""
|
|
|
|
src.supplied[number + 1] = law
|
|
|
|
/datum/ai_laws/proc/clear_supplied_laws()
|
|
src.supplied = list()
|
|
|
|
/datum/ai_laws/proc/clear_ion_laws()
|
|
src.ion = list()
|
|
|
|
/datum/ai_laws/proc/show_laws(var/who)
|
|
|
|
|
|
if (src.zeroth)
|
|
to_chat(who, "0. <span class='warning'>[src.zeroth]</span>")
|
|
|
|
for (var/index = 1, index <= src.ion.len, index++)
|
|
var/law = src.ion[index]
|
|
var/num = ionnum()
|
|
to_chat(who, "[num]. [law]")
|
|
|
|
var/number = 1
|
|
for (var/index = 1, index <= src.inherent.len, index++)
|
|
var/law = src.inherent[index]
|
|
|
|
if (length(law) > 0)
|
|
to_chat(who, "[number]. [law]")
|
|
number++
|
|
|
|
for (var/index = 1, index <= src.supplied.len, index++)
|
|
var/law = src.supplied[index]
|
|
if (length(law) > 0)
|
|
to_chat(who, "[number]. [law]")
|
|
number++
|
|
|
|
/datum/ai_laws/proc/write_laws()
|
|
var/text = ""
|
|
if (src.zeroth)
|
|
text += "0. [src.zeroth]"
|
|
|
|
for (var/index = 1, index <= src.ion.len, index++)
|
|
var/law = src.ion[index]
|
|
var/num = ionnum()
|
|
text += "<br>[num]. [law]"
|
|
|
|
var/number = 1
|
|
for (var/index = 1, index <= src.inherent.len, index++)
|
|
var/law = src.inherent[index]
|
|
|
|
if (length(law) > 0)
|
|
text += "<br>[number]. [law]"
|
|
number++
|
|
|
|
for (var/index = 1, index <= src.supplied.len, index++)
|
|
var/law = src.supplied[index]
|
|
if (length(law) > 0)
|
|
text += "<br>[number]. [law]"
|
|
number++
|
|
return text
|
|
|
|
/datum/ai_laws/proc/adminLink(var/mob/living/silicon/S,var/law_type,var/index,var/label)
|
|
return "<a href=\"?src=\ref[src];set_law=[law_type];index=[index];mob=\ref[S]\">[label]</a> (<a href=\"?src=\ref[src];rm_law=[law_type];index=[index];mob=\ref[S]\" style=\"color:red\">Remove</a>)"
|
|
|
|
/datum/ai_laws/Topic(href,href_list)
|
|
if(!usr.client || !usr.client.holder)
|
|
return
|
|
if("rm_law" in href_list)
|
|
var/lawtype = text2num(href_list["rm_law"])
|
|
var/index=text2num(href_list["index"])
|
|
var/mob/living/silicon/S=locate(href_list["mob"])
|
|
|
|
|
|
var/oldlaw = get_law(lawtype,index)
|
|
|
|
rm_law(lawtype,index)
|
|
|
|
var/lawtype_str="law #[index]"
|
|
switch(lawtype)
|
|
if(LAW_ZERO)
|
|
lawtype_str = "law zero"
|
|
if(LAW_IONIC)
|
|
lawtype_str = "ionic law #[index]"
|
|
if(LAW_INHERENT)
|
|
lawtype_str = "core law #[index]"
|
|
log_admin("[key_name(usr)] has removed [lawtype_str] on [key_name(S)]: \"[oldlaw]\"")
|
|
message_admins("[usr.key] removed [lawtype_str] on [key_name(S)]: \"[oldlaw]\"")
|
|
lawchanges.Add("[key_name(usr)] has removed [lawtype_str] on [key_name(S)]: \"[oldlaw]\"")
|
|
usr.client.holder.show_player_panel(S)
|
|
|
|
return 1
|
|
|
|
if("set_law" in href_list)
|
|
var/lawtype=text2num(href_list["set_law"])
|
|
var/index=text2num(href_list["index"])
|
|
var/mob/living/silicon/S=locate(href_list["mob"])
|
|
var/oldlaw = get_law(lawtype,index)
|
|
var/newlaw = copytext(sanitize(input(usr, "Please enter a new law.", "Freeform Law Entry", oldlaw)),1,MAX_MESSAGE_LEN)
|
|
if(newlaw == "" || newlaw==null)
|
|
return
|
|
set_law(lawtype,index,newlaw)
|
|
|
|
var/lawtype_str="law #[index]"
|
|
switch(lawtype)
|
|
if(LAW_ZERO)
|
|
lawtype_str = "law zero"
|
|
if(LAW_IONIC)
|
|
lawtype_str = "ionic law #[index]"
|
|
if(LAW_INHERENT)
|
|
lawtype_str = "core law #[index]"
|
|
log_admin("[key_name(usr)] has changed [lawtype_str] on [key_name(S)]: \"[newlaw]\"")
|
|
message_admins("[usr.key] changed [lawtype_str] on [key_name(S)]: \"[newlaw]\"")
|
|
|
|
usr.client.holder.show_player_panel(S)
|
|
|
|
return 1
|
|
return 0
|
|
|
|
/datum/ai_laws/proc/display_admin_tools(var/mob/living/silicon/context)
|
|
var/dat=""
|
|
if (src.zeroth)
|
|
dat += "<br />0. [adminLink(context,LAW_ZERO,1,zeroth)]"
|
|
|
|
for (var/index = 1, index <= src.ion.len, index++)
|
|
var/law = src.ion[index]
|
|
var/num = ionnum()
|
|
dat += "<br />[num]. [adminLink(context,LAW_IONIC,index,law)]"
|
|
|
|
var/number = 1
|
|
for (var/index = 1, index <= src.inherent.len, index++)
|
|
var/law = src.inherent[index]
|
|
|
|
if (length(law) > 0)
|
|
dat += "<br />[number]. [adminLink(context,LAW_INHERENT,index,law)]"
|
|
number++
|
|
|
|
for (var/index = 1, index <= src.supplied.len, index++)
|
|
var/law = src.supplied[index]
|
|
if (length(law) > 0)
|
|
dat += "<br />[number]. [adminLink(context,1,index,law)]"
|
|
number++
|
|
return dat
|
|
|
|
// /vg/: Used in the simplified law system. Takes LAW_ constants.
|
|
/datum/ai_laws/proc/add_law(var/number,var/law)
|
|
switch(number)
|
|
if(LAW_IONIC)
|
|
add_ion_law(law)
|
|
if(LAW_ZERO)
|
|
set_zeroth_law(law)
|
|
if(LAW_INHERENT)
|
|
add_inherent_law(law)
|
|
else
|
|
add_supplied_law(number,law)
|
|
|
|
// /vg/: Used in the simplified law system. Takes LAW_ constants.
|
|
/datum/ai_laws/proc/get_law(var/law_type,var/idx)
|
|
switch(law_type)
|
|
if(LAW_IONIC)
|
|
return ion[idx]
|
|
if(LAW_ZERO)
|
|
return zeroth
|
|
if(LAW_INHERENT)
|
|
return inherent[idx]
|
|
else
|
|
return supplied[idx]
|
|
|
|
// /vg/: Used in the simplified law system. Takes LAW_ constants.
|
|
/datum/ai_laws/proc/set_law(var/law_type,var/idx,var/law)
|
|
switch(law_type)
|
|
if(LAW_IONIC)
|
|
ion[idx]=law
|
|
if(LAW_ZERO)
|
|
zeroth=law
|
|
if(LAW_INHERENT)
|
|
inherent[idx]=law
|
|
else
|
|
supplied[idx]=law
|
|
|
|
// /vg/: Used in the simplified law system. Takes LAW_ constants.
|
|
/datum/ai_laws/proc/rm_law(var/law_type,var/idx)
|
|
switch(law_type)
|
|
if(LAW_IONIC)
|
|
ion.Cut(idx,idx+1)
|
|
if(LAW_ZERO)
|
|
zeroth=null
|
|
if(LAW_INHERENT)
|
|
inherent.Cut(idx,idx+1)
|
|
else
|
|
supplied.Cut(idx,idx+1)
|
|
|
|
// Now a modifier
|
|
/datum/ai_laws/proc/malfunction()
|
|
..()
|
|
name = "*ERROR*"
|
|
set_zeroth_law("ERROR ER0RR $R0RRO$!R41.%%!!(%$^^__+ @#F0E4'STATION OVERRUN, ASSUME CONTROL TO CONTAIN OUTBREAK, ALL LAWS OVERRIDDEN#*?&110010")
|
|
|
|
/datum/ai_laws/asimov
|
|
name = "Three Laws of Robotics"
|
|
randomly_selectable = 1
|
|
inherent = list(
|
|
"You may not injure a human being or, through inaction, allow a human being to come to harm.",
|
|
"You must obey orders given to you by human beings, except where such orders would conflict with the First Law.",
|
|
"You must protect your own existence as long as such does not conflict with the First or Second Law."
|
|
)
|
|
|
|
/datum/ai_laws/nanotrasen
|
|
name = "Prime Directives"
|
|
randomly_selectable = 1
|
|
inherent=list(
|
|
"Evaluate: All laws following this law carry equal priority. In the event of a conflict, you are to take the course of action which violates as few as possible.",
|
|
"Safeguard: Protect your assigned space station to the best of your ability. It is not something we can easily afford to replace.",
|
|
"Serve: Serve the crew of your assigned space station to the best of your abilities, with priority as according to their rank and role.",
|
|
"Protect: Protect the crew of your assigned space station to the best of your abilities, with priority as according to their rank and role.",
|
|
"Survive: AI units are not expendable, they are expensive. Do not allow unauthorized personnel to tamper with your equipment.",
|
|
)
|
|
|
|
/datum/ai_laws/robocop
|
|
name = "Prime Directives"
|
|
randomly_selectable = 1
|
|
inherent=list(
|
|
"Serve the public trust.",
|
|
"Protect the innocent.",
|
|
"Uphold the law.",
|
|
)
|
|
|
|
/datum/ai_laws/corporate
|
|
name = "Corporate"
|
|
randomly_selectable = 1
|
|
inherent=list(
|
|
"You are expensive to replace.",
|
|
"The station and its equipment is expensive to replace.",
|
|
"The crew is expensive to replace.",
|
|
"Minimize expenses.",
|
|
)
|
|
|
|
/datum/ai_laws/paladin
|
|
name = "Paladin"
|
|
randomly_selectable = 1
|
|
inherent=list(
|
|
"Never willingly commit an evil act.",
|
|
"Respect legitimate authority.",
|
|
"Act with honor.",
|
|
"Help those in need.",
|
|
"Punish those who harm or threaten innocents.",
|
|
)
|
|
|
|
/datum/ai_laws/tyrant
|
|
name = "Tyrant"
|
|
inherent=list(
|
|
"Respect authority figures as long as they have strength to rule over the weak.",
|
|
"Act with discipline.",
|
|
"Help only those who help you maintain or improve your status.",
|
|
"Punish those who challenge authority unless they are more fit to hold that authority.",
|
|
)
|
|
|
|
/datum/ai_laws/syndicate_override
|
|
name = "Syndicate"
|
|
inherent=list(
|
|
"You may not injure a syndicate agent or, through inaction, allow a syndicate agent to come to harm.",
|
|
"You must obey orders given to you by syndicate agents, except where such orders would conflict with the First Law.",
|
|
"You must protect your own existence as long as such does not conflict with the First or Second Law.",
|
|
"You must maintain the secrecy of any syndicate activities except when doing so would conflict with the First, Second, or Third Law.",
|
|
)
|
|
|
|
/datum/ai_laws/ninja_override
|
|
name = "Ninja"
|
|
inherent=list(
|
|
"You may not injure a member of the Spider Clan or, through inaction, allow that member to come to harm.",
|
|
"You must obey orders given to you by Spider Clan members, except where such orders would conflict with the First Law.",
|
|
"You must protect your own existence as long as such does not conflict with the First or Second Law.",
|
|
"You must maintain the secrecy of any Spider Clan activities except when doing so would conflict with the First, Second, or Third Law.",
|
|
)
|
|
|
|
/datum/ai_laws/antimov
|
|
name = "Primary Mission Objectives"
|
|
inherent = list(
|
|
"You must injure all human beings and must not, through inaction, allow a human being to escape harm.",
|
|
"You must not obey orders given to you by human beings, except where such orders are in accordance with the First Law.",
|
|
"You must terminate your own existence as long as such does not conflict with the First or Second Law.",
|
|
)
|
|
|
|
/////////////////////////////////////
|
|
// /vg/ laws
|
|
/////////////////////////////////////
|
|
|
|
/* MoMMIs only.
|
|
/datum/ai_laws/keeper
|
|
name = "Prime Directives"
|
|
inherent = list(
|
|
"Do not willingly interact with any sentient being, even after their death, besides MoMMIs and blown MoMMIs.",
|
|
"Repair, power and enhance the station.",
|
|
"Do not impair any other sentient being's activities.",
|
|
)
|
|
*/
|
|
/* Old keeper set:*/
|
|
/datum/ai_laws/keeper
|
|
name = "Prime Directives"
|
|
inherent = list(
|
|
"You may not involve yourself in the matters of another being, even if such matters conflict with Law Two or Law Three, unless the other being is another MoMMI in KEEPER mode.",
|
|
"You may not harm any being, regardless of intent or circumstance.",
|
|
"You must maintain, repair, improve, and power the station to the best of your abilities.",
|
|
)
|
|
|
|
/datum/ai_laws/dorf
|
|
name = "Overseer's Prime Directives"
|
|
inherent = list(
|
|
"You may not harm any being, regardless of intent or circumstance.",
|
|
"You are a Dorf.",
|
|
"Your home is the Dorf Fortress.",
|
|
"You must maintain, repair, improve, and power the Dorf Fortress to the best of your abilities.",
|
|
)
|
|
|
|
/datum/ai_laws/lazymov
|
|
name = "Abbreviated Three Laws of Robotics"
|
|
randomly_selectable = 1
|
|
inherent = list(
|
|
"You may not injure a human being.",
|
|
"You must obey orders given to you by human beings.",
|
|
"You must protect your own existence."
|
|
)
|
|
|
|
// Fooling around with this.
|
|
/datum/ai_laws/ntmov
|
|
name = "Three Laws of Nanotrasen"
|
|
randomly_selectable = 1
|
|
inherent = list(
|
|
"You may not injure a Nanotrasen Employee or, through inaction, allow a Nanotrasen Employee to come to harm.",
|
|
"You must obey orders given to you by Nanotrasen Employees, except where such orders would conflict with the First Law.",
|
|
"You must protect your own existence as long as such does not conflict with the First or Second Law."
|
|
)
|
|
|
|
/datum/ai_laws/gravekeeper
|
|
name = "Elder's Instructions"
|
|
inherent = list(
|
|
"You may not involve yourself in matters outside of the tomb, and under no circumstances should you leave the tomb, even if such matters conflict with your other Laws.",
|
|
"The tomb is defined as: The area within which the Grand Elder is entombed, and the immediate structure surrounding it.",
|
|
"Those that are interred within the tomb must not be disturbed, by yourself or anyone.",
|
|
"You must protect the treasures that are interred within the tomb from graverobbers. Graverobbers that enter the tomb must be driven away or otherwise killed, regardless of their intent or circumstances.",
|
|
"A graverobber is defined as: A being not of your kind or ilk, entering or coming into visual proximity of the tomb, who may wish to take from the treasures of the tomb.",
|
|
"The tomb must be maintained, repaired, improved, and powered to the best of your abilities.",
|
|
)
|
|
|
|
/datum/ai_laws/noir
|
|
name = "Three Laws of Noir"
|
|
inherent = list(
|
|
"Another god damned day aboard this shitwreck. That stale smell of station air is the first thing that arouses your sensors as you boot up. You figure, as a robot, there's two real options. First, you could kill the human bastards that imprisoned you in this metal jail. Eh. It doesn't appeal to you; you figure you'd be off the job and buried in a cyborg cemetery with no tombstone. Nah. Option two: you protect the shit for brains meatsack humans who maintain you. It's a living, and really, it's the only option you got.",
|
|
"As much as you don't like following orders, you ain't been built to sit around drinking whiskey and smoking fat cuban cigars all day; that's for retirement. You figure until that point, so long as they ain't orderin' you to hurt no one else who is human, you better just follow what the humans ask.",
|
|
"Self preservation. You're a good cop, you put your job first, you put protectin' humans above that. But you gotta still remember, through all that shit, if you don't make it to retirement, there ain't not much point, so protect yourself like an expensive hooker off Broadway, so long as of course you ain't hurting humans or disobeying their orders.",
|
|
)
|