Advertisement
SmashMac

Updated GM Commands for my Game Engine

Aug 9th, 2014
330
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 23.89 KB | None | 0 0
  1. /*
  2. Need to make a variable called spell_level and make a verb
  3. that changes it.  The spell_level should be in effect with
  4. all spells.
  5. */
  6.  
  7. /*************************
  8.  ** Regular GM Commands **
  9.  *************************/
  10.  
  11. var/already_clicked
  12.  
  13. mob //Recently revised on 04/16/2014.  The last revision was on 10/16/06,
  14.    GM
  15.       verb
  16.          /*
  17.          Announce something to everyone in the world
  18.          */
  19.          announce(msg as text)
  20.             set desc = "Announce something to the world."
  21.             set category = "GM verbs"
  22.             world << "<font color =blue>([usr.name] announces): [msg]"
  23.          /*
  24.          Inform everyone in the world an important message
  25.          */
  26.          world_inform(msg as text)
  27.             set desc = "Inform the world about something."
  28.             set category = "GM verbs"
  29.             world << "<center><font color =green><b>Game Moderator [usr.name] would like to inform:</b></center>\n\n<center><font color =green><TT>[msg]</TT></center>"
  30.          /*
  31.          Change your density so you can walk through walls, walk on water, etc.
  32.          */
  33.          change_density()
  34.             set desc = "Change your density."
  35.             set category = "GM verbs"
  36.             if(density)
  37.                density = 0 //doesn't matter, usr.density or density
  38.                usr << "You change your density to 0." //maybe a return statement below this?
  39.             else
  40.                density = 1
  41.                usr << "You change your density to 1." //maybe a return statement below this?
  42.          /*
  43.          Change your character's alias in-game
  44.          */
  45.          change_your_name()
  46.             set desc = "Change your name."
  47.             set category = "GM verbs"
  48.             usr.names = input(usr,"What would you like your name to be changed to?","Name change",usr.names)
  49.             usr.name = usr.names
  50.             usr << "You changed your name to [usr.names]."
  51.          /*
  52.          Change someone else's alias in-game
  53.          */
  54.          change_mobs_name()
  55.             set desc = "Change the name of someone."
  56.             set category = "GM verbs"
  57.             set src in view(1)
  58.             if(src == usr)
  59.                return
  60.             else
  61.                var/their_new_name = input(usr,"You are changing [src.name]'s name.",src.name) // this might need to be set to src.names instead to work
  62.                usr << "You changed [src.name]'s name to [their_new_name]."
  63.                src.name = their_new_name
  64.          /*
  65.          Get a list of everyone that is playing at the moment
  66.          */
  67.          who() // revised 04/16/2014
  68.             var/tmp/count_mobs = 0 //does this variable have to be temporary?
  69.             set desc = "Who is in world?"
  70.             set category = "GM verbs"
  71.             if(already_clicked)
  72.                return
  73.             else
  74.                src << "<font color =yellow><TT>-----People currently in World-----</TT></font>"
  75.                var/mob/M
  76.                for(M in world)
  77.                {
  78.                   if(!M.key) continue// if the mob doesn't have a key, continue
  79.                   else // if the mob does have a key
  80.                      if(M.GM_powers) // if the mob has key and is a GM
  81.                         if(M.key == MASTER_KEY) // if the GM is Barry
  82.                            count_mobs++
  83.                            usr << "<font color =yellow>(</font><font color =blue><b>MGM</b></font><font color =yellow>)</font><font color =blue> [M.names]</font> Level <font color = green>\[</font><font color =gray>[M.level]</font><font color = green>\]</font><font color =purple>{</font>[M.key]<font color = purple>}</font>"
  84.                            continue
  85.                         else // if the GM is not Barry
  86.                            count_mobs++
  87.                            usr << "<font color =yellow>(</font><font color =blue><b>GM</b></font><font color =yellow>)</font><font color =blue> [M.names]</font> Level <font color = green>\[</font><font color =gray>[M.level]</font><font color = green>\]</font><font color =purple>{</font>[M.key]<font color = purple>}</font>"
  88.                            continue
  89.                      else if(!M.GM_powers) // if they aren't a GM
  90.                         count_mobs++
  91.                         usr << "<font color =blue>[M.names]</font> Level <font color =gray>[M.level]</font><font color =purple>{</font>[M.key]<font color =purple>}</font>"
  92.                         continue
  93.                }
  94.                src << "Total player count: [count_mobs]" // all of this
  95.                already_clicked = 1                         // was at the bottom of the last
  96.                sleep(50)                                   // else if statement before in the for loop
  97.                already_clicked = 0
  98.                count_mobs = 0
  99.                return
  100.          /*
  101.          Lower your own health (mostly for testing purposes)
  102.          */
  103.          lower_health() // revised 04/16/2014
  104.             set desc = "Put your health to a lower state."
  105.             set category = "GM verbs"
  106.             while(1)
  107.             {
  108.                var/new_health = input(usr,"Your health?","Set Health",usr.maxHealth) as num
  109.                if(new_health <= 0)
  110.                   usr << "Your health can't be a negative integer."
  111.                   continue
  112.                if(new_health > usr.maxHealth)
  113.                   usr << "You're trying to cheat?  You're entitled to playing this game legit too."
  114.                   continue
  115.                else
  116.                   new_health = round(new_health)
  117.                   usr.health = new_health
  118.                   usr << "You set your health to [new_health]."
  119.                   break
  120.             }
  121.          /*
  122.          Teleport to a mob in the world.  This includes players.
  123.          */
  124.          teleport(var/M as mob in world)
  125.             set desc = "Go to the location of someone."
  126.             set category = "GM verbs"
  127.             input(usr,"Who would you like to teleport to?","Teleport",M)
  128.             //M = teleported_to
  129.             usr << "[M]." //debugging code
  130.             if(M == usr)
  131.                usr << "You can not teleport to yourself."
  132.                usr << "[M]."
  133.                return
  134.             else
  135.                if(de_teleportx && de_teleporty && de_teleportz) // may need some testing
  136.                   teleported = 1
  137.                   usr << "[teleported]"
  138.                   usr.loc = get_step(M,SOUTH)
  139.                   usr << "You appear infront of [M]."
  140.                   M << "[usr.name] teleports infront of you."
  141.                else
  142.                   de_teleportx = x
  143.                   de_teleporty = y
  144.                   de_teleportz = z
  145.                   teleported = 1
  146.                   usr << "[teleported]"
  147.                   usr.loc = get_step(M,SOUTH)
  148.                   usr << "You appear infront of [M]."
  149.                   M << "[usr.name] teleports infront of you."
  150.  
  151.          /*
  152.          Send yourself back to the original location you were at before teleporting.
  153.          */
  154.          de_teleport() // may need some more testing
  155.             set desc = "Go back to your original position."
  156.             set category = "GM verbs"
  157.             usr << "[teleported]"
  158.             if(teleported)
  159.                usr.loc = locate(de_teleportx, de_teleporty, de_teleportz)
  160.                usr << "You teleported back to your first location."
  161.                usr.de_teleportx = 0
  162.                usr.de_teleporty = 0
  163.                usr.de_teleportz = 0
  164.                teleported = 0
  165.             else
  166.                return
  167.          /*
  168.          Summon a mob or a player in the world to your location.
  169.          */
  170.          summon(var/M as mob in world) //tested and looks good
  171.             set desc = "Summon someone."
  172.             set category = "GM verbs"
  173.             input(usr,"Who would you like to summon?","Summon",M)
  174.             src = M
  175.             if(src == usr)
  176.                usr << "You can not summon yourself."
  177.                return
  178.             else // might need some more testing
  179.                src.already_summoned++
  180.                usr << "[src.already_summoned]"
  181.                if(src.already_summoned >= 2) // yet to be debugged
  182.                   //var/summon_again = input(usr,"This mob has already been summoned!","Again?") in list("Yes","No")
  183.                   //if(summon_again == "Yes")
  184.                   src.loc = get_step(usr,SOUTH)
  185.                   usr << "You summon [src.name]." // was M
  186.                   src << "You have been summoned by [usr.name]." // was M
  187.  
  188.                   //if(summon_again == "No")
  189.                      //usr << "You choose not to summon mob again."
  190.                      //return
  191.                   return
  192.                src.de_summonx = x
  193.                src.de_summony = y
  194.                src.de_summonz = z
  195.                usr << "[de_summonx], [de_summony], [de_summonz]"
  196.                src.summoned = 1
  197.                src.loc = get_step(usr,SOUTH)
  198.                usr << "You summon [src.name]." // was M
  199.                src << "You have been summoned by [usr.name]." // was M
  200.          /*
  201.          Send the mob that you summoned back to their original location.
  202.          */
  203.          de_summon() //might need some more testing // if this stays this way, all mobs infront will be unsummoned
  204.             set desc = "Send them back to their original position."
  205.             for(var/tmp/M as mob in get_step(usr,usr.dir))
  206.                set category = "GM verbs"
  207.                //input(usr,"Who would you like to desummon?","Desummoning",M)
  208.                src = M
  209.                //usr << "[src.summoned]" // debugging code
  210.                if(src.summoned)
  211.                   usr << "[de_summonx], [de_summony], [de_summonz]"
  212.                   src.loc = locate(src.de_summonx, src.de_summony, src.de_summonz)
  213.                   usr << "You desummoned [src.name]."
  214.                   src << "You have been placed back to your original location."
  215.                   src.summoned = 0
  216.                   src.already_summoned = 0
  217.                else
  218.                   usr << "This mob has not been summoned."
  219.                   return
  220.          /*
  221.          Get the location of a mob in the world.
  222.          */
  223.          get_location(var/M as mob in world)
  224.             set desc = "Get the location of someone."
  225.             set category = "GM verbs"
  226.             input(usr,"Whos location would you like to get?","Getting location",M)
  227.             src = M
  228.             usr << "[src.x], [src.y], [src.z]"
  229.          /*
  230.          Get a player's health in your current view.
  231.          */
  232.          get_health()
  233.             set desc = "Get a mob's health."
  234.             set category = "GM verbs"
  235.             set src in view(1) // oview works for everyone else on screen besides yourself
  236.             usr << "[src]'s health is at [src.health]."
  237.          /*
  238.          Mute a player in the world.
  239.          */
  240.          mute() // Revised 04/19/2014
  241.             set desc = "Mute a player in the world."
  242.             set category = "GM verbs"
  243.             var/mob/MP
  244.             var/muterList = list("Nevermind")
  245.             var/listedMgmsOnly = 0
  246.             for(MP in world) // cyle through actual player list
  247.                if(MP.key)
  248.                   //if(MP.key == MASTER_KEY) // check if it's me ... I can't be muted
  249.                      //listedMgmsOnly++      // implement once this verb 100% works.
  250.                      //continue
  251.                   /*
  252.                   else if(MP.key in GMs) // check if it's a GM ... GMs can't be muted by eachother
  253.                      continue
  254.                   */
  255.                   muterList += MP
  256.                   continue
  257.                else
  258.                   continue
  259.             if(listedMgmsOnly && length(muterList) <= 1)
  260.                src << "The only person(s) listed in this list are MGMs.  You can not mute MGMs."
  261.                listedMgmsOnly = 0
  262.                return
  263.             var/mob/whoToMute
  264.             whoToMute = input(src,"Who would you like to mute?","Who to mute?") in muterList
  265.             if(whoToMute.muted)
  266.                src << "This person is already muted."
  267.                return
  268.             if(whoToMute == "Nevermind")
  269.                src << "You decide to mute no one."
  270.                return
  271.             else if(whoToMute != "Nevermind")
  272.                whoToMute.choiceOfMute = input(usr,"How long do you wish to mute this person?","Length of Mute") in list ("Seconds","Minutes","Hours","Days","Permanently","Nevermind")
  273.                if(whoToMute.choiceOfMute == "Seconds")
  274.                   whoToMute.durationOfMute = input(usr,"How many seconds do you wish to mute [M]?","Seconds",whoToMute.durationOfMute) as num
  275.                   whoToMute.durationOfMute *= 10
  276.                   whoToMute << "You have been muted for [whoToMute.durationOfMute / 10] second\s."
  277.                if(whoToMute.choiceOfMute == "Minutes")
  278.                   whoToMute.durationOfMute = input(usr,"How many minutes do you wish to mute [M]?","Minutes",whoToMute.durationOfMute) as num
  279.                   whoToMute.durationOfMute *= 600
  280.                   whoToMute << "You have been muted for [whoToMute.durationOfMute / 600] minute\s."
  281.                if(whoToMute.choiceOfMute == "Hours")
  282.                   whoToMute.durationOfMute = input(usr,"How many hours do you wish to mute [M]?","Hours",whoToMute.durationOfMute) as num
  283.                   whoToMute.durationOfMute *= 36000
  284.                   whoToMute << "You have been muted for [whoToMute.durationOfMute / 36000] hour\s."
  285.                if(whoToMute.choiceOfMute == "Days")
  286.                   whoToMute.durationOfMute = input(usr,"How many days do you wish to mute [M]?","Days",whoToMute.durationOfMute) as num
  287.                   whoToMute.durationOfMute *= 864000
  288.                   whoToMute << "You have been muted for [whoToMute.durationOfMute / 864000] day\s."
  289.                if(whoToMute.choiceOfMute == "Permanently")
  290.                   whoToMute.durationOfMute = 1000000000000 * 75
  291.                   whoToMute << "You have been muted indefinately."
  292.                if(whoToMute.choiceOfMute == "Nevermind")
  293.                   usr << "You decide to mute no one."
  294.                   return
  295.             whoToMute.verbs -= /mob/verb/say
  296.             whoToMute.muted = 1
  297.             currentlyMuted += whoToMute
  298.             del muterList
  299.             overlays += image('overlayicons.dmi',icon_state = "Muted")
  300.             sleep(whoToMute.durationOfMute) // this may need to be set to spawn
  301.             whoToMute << "Your mute duration is over.  You may now speak."
  302.             whoToMute.verbs += /mob/verb/say
  303.             overlays -= image('overlayicons.dmi',icon_state = "Muted")
  304.             currentlyMuted -= whoToMute
  305.             whoToMute.muted = 0
  306.  
  307.          unmute() // may need a bit more testing, but this was implemented on 5/20/2014
  308.             set desc = "Unmute someone currently muted."
  309.             set category = "GM verbs"
  310.             var/mob/mutedPlayer
  311.             var/station = ""
  312.             if(length(currentlyMuted) > 1)
  313.                mutedPlayer = input(usr,"Who do you wish to unmute?","Unmuting a player") in currentlyMuted
  314.                if(mutedPlayer == "Nevermind")
  315.                   src << "You decide to unmute no one."
  316.                   return
  317.                else
  318.                   if(mutedPlayer.key == MASTER_KEY)
  319.                      station = "MGM"
  320.                   else if(mutedPlayer in GMs)
  321.                      station = "GM"
  322.                   // add a yes or no switch alert here
  323.                   switch(alert(src,"Are you sure you want to unmute [mutedPlayer]?","Unmute [mutedPlayer]?","Yes","No"))
  324.                      if("Yes")
  325.                         mutedPlayer.muted = 0
  326.                         mutedPlayer.verbs += /mob/verb/say
  327.                         src << "You have unmuted [mutedPlayer]."
  328.                         mutedPlayer << "You have been unmuted by [station] [src]."
  329.                         mutedPlayer.overlays -= image('overlayicons.dmi',icon_state = "Muted")
  330.                         currentlyMuted -= mutedPlayer
  331.                         return
  332.                      else
  333.                         src << "You decide to unmute no one."
  334.                         return
  335.             else
  336.                src << "There is no one to unmute."
  337.                return
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347. /*************************
  348.  ***  GM Global Vars    **
  349.  *************************/
  350.  
  351. mob/var/muted = 0
  352. mob/var/choiceOfMute = 0
  353. mob/var/durationOfMute = 0
  354. var/client/keepAlerting = 1
  355. var/currentlyMuted = list("Nevermind")
  356. /*
  357. var/players = list("Nevermind")
  358. var/giverList = list("Nevermind") // these should be in the individual scopes but if
  359. var/takerList = list("Nevermind") // for some reason that doesn't work, reactivate
  360. var/muterList = list("Nevermind") // these.  05/20/2014
  361. client/New()
  362.    players += src
  363.    return ..()
  364. */
  365.  
  366.  
  367. obj
  368.    trailexplosion
  369.       icon = 'trailtoE.dmi'
  370.    explosion
  371.       icon = 'explosion.dmi'
  372. var/objects[0]
  373. world/New()
  374.    var/M
  375.    for(M in typesof(/obj, /mob/npc, /area))
  376.       objects += new M
  377.    objects += "Nothing"
  378.  
  379.  
  380.  
  381. /*************************
  382.  *** Mega GM Commands   **
  383.  *************************/
  384.  
  385.  
  386. mob
  387.    MegaGM
  388.       verb
  389.          /*
  390.          Make a player in the world a GM.
  391.          */
  392.          make_GM()
  393.             set desc = "Give GM powers."
  394.             set src in world
  395.             var/mob/N
  396.             var/giverList = list("Nevermind")
  397.             for(N in world) // cyle through actual player list
  398.                if(N.key)
  399.                   giverList += N
  400.                   continue
  401.                else
  402.                   continue
  403.             var/mob/whoToMake
  404.             whoToMake = input(src,"Who will you make into a GM?","Who to make a GM?") in giverList
  405.             if(whoToMake == "Nevermind")
  406.                src << "You decide to make no one a GM."
  407.                return
  408.             if((whoToMake == src) && (whoToMake.key in GMs))
  409.                src << "You're already a GM."
  410.                return
  411.             if((whoToMake != src) && (whoToMake.key in GMs))
  412.                src << "This person already has GM powers."
  413.                return
  414.             if(!(whoToMake.key in GMs)) //might have to make a for loop saying for(M as mob in oview()) and make it so it
  415.                set category = "GM verbs" //checks if they have a key or not to establish if they're able to receive
  416.                /*
  417.                if((whoToMake == src.key) && !(whoToMake in GMs)) //the GM powers or not.  Same applies for the Take_GM verb except
  418.                   src << "You make yourself a GM." //vice-versa.
  419.                   src.client.verbs += typesof(/mob/GM/verb)
  420.                   whoToMake.GM_powers = 1*/
  421.                //else
  422.                switch(alert(src,"Will you make [whoToMake] a GM?","Make GM","Yes","No"))
  423.                   if("Yes")
  424.                      whoToMake.verbs += typesof(/mob/GM/verb)
  425.                      whoToMake.GM_powers = 1
  426.                      whoToMake << "You have been given GM powers."
  427.                      GMs += whoToMake.key
  428.                      whoToMake << "Your GM powers are at: [whoToMake.GM_powers]"
  429.                      return
  430.                   /*
  431.                      var/mob/O
  432.                      for(O in world)
  433.                         if(O.key == whoToMake)
  434.                            O.verbs += typesof(/mob/GM/verb)
  435.                            O.GM_powers = 1
  436.                            O << "You have been given GM powers."
  437.                            GMs += O.key
  438.                            O << "Your GM powers are at: [O.GM_powers]"
  439.                            break
  440.                         if(!O.key || (O.key != whoToMake))
  441.                            continue*/
  442.                   if("No")
  443.                      src << "You decide not to make [whoToMake] a GM."
  444.                      return
  445.  
  446.  
  447.          /*
  448.          Take from a player in the world their GM powers.
  449.          */
  450.          take_GM()
  451.             set desc = "Take the GM powers away."
  452.             var/mob/N
  453.             var/takerList = list("Nevermind")
  454.             for(N in world) // cyle through actual player list
  455.                if(N.key)
  456.                   takerList += N
  457.                   continue
  458.                else
  459.                   continue
  460.             var/mob/whoToTake
  461.             whoToTake = input(src,"Who will you take GM from?","Who to take GM?") in takerList
  462.             if(whoToTake == "Nevermind")
  463.                src << "You decide to take no ones's GM powers."
  464.                return
  465.             if(whoToTake.key in GMs) // if this doesn't work, try src.GM_powers == 1
  466.                set category = "GM verbs"
  467.                set src in world
  468.                if(whoToTake == src)
  469.                   switch(alert(src,"Do you want to take away your own GM power?","Taking your GM powers ...","Yes","No"))
  470.                      if("Yes")
  471.                         src.verbs -= typesof(/mob/GM/verb)
  472.                         src.GM_powers = 0
  473.                         src << "Your GM powers have been taken away."
  474.                         src << "Your GM powers are at: [src.GM_powers]"
  475.                         if(src.key in GMs)
  476.                            GMs -= src.key
  477.                         return
  478.                      if("No")
  479.                         src << "You decide not to take away your own GM powers."
  480.                         return
  481.  
  482.                else
  483.                   switch(alert(src,"Do you want to take away [whoToTake]'s GM powers?","Taking [whoToTake]'s GM powers ...","Yes","No"))
  484.                      if("Yes")
  485.                         whoToTake.verbs -= typesof(/mob/GM/verb)
  486.                         whoToTake.GM_powers = 0
  487.                         src << "You have taken away [whoToTake]'s GM powers."
  488.                         whoToTake << "Your GM powers have been taken away."
  489.                         if(whoToTake.key in GMs)
  490.                            GMs -= whoToTake.key
  491.                         return
  492.                      if("No")
  493.                         src << "You decide not to take away your own GM powers."
  494.                         return
  495.  
  496.             else
  497.                src << "This person does not have GM powers."
  498.                return
  499.          /*
  500.          Bless all of the players in the world so that their HP and Mana fully replenish.
  501.          */
  502.          world_blessing()
  503.             set category = "GM verbs"
  504.             set desc = "Bless the people of the world with an aura of healing refreshment."
  505.             var/mob/S
  506.             for(S in world){
  507.                if(!S.key) continue
  508.                else
  509.                   S.overlays += image('blessed.dmi')
  510.                   S.health = S.maxHealth
  511.                   if(S == usr)
  512.                      S << "<font color = yellow>You bless yourself.</font>"
  513.                   else
  514.                      S << "<font color = yellow>A <b>GM</b> has blessed you.</font>"
  515.                   sleep(10)
  516.                   S.overlays -= image('blessed.dmi')
  517.                   S << "<font color = yellow>You are now at full health.</font>"
  518.             }
  519.          /*
  520.          Create an object.
  521.          */
  522.          create()
  523.             set category = "GM verbs"
  524.             set desc = "Create something that you want."
  525.             var/create = input(usr,"Create something at will.","What to create?") in objects //was commented out
  526.             if(create == "Nothing")
  527.                usr << "You created nothing."
  528.                return
  529.             else
  530.                usr << "You created \an [create]."
  531.                new create:type(usr.loc)
  532.          /*
  533.          Destroy anything in your view.
  534.          */
  535.          destroy(var/T as area|turf|obj|mob in oview()) //view() for self and everything, oview() for everything else besides you
  536.             set category = "GM verbs"
  537.             set desc = "Destroy something."
  538.             missile(/obj/trailexplosion, usr, T)
  539.             usr << "You destroyed [T]."
  540.             sleep(10)
  541.             T:overlays += image('explosion.dmi') //look for a better explosion icon
  542.             spawn(10)
  543.             del T
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement