SmashMac

My GM commands for my game engine

Aug 21st, 2013
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 17.13 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. var/already_clicked
  7.  
  8. mob //the useful verbs for the GM have been pretty much checked as of 10/16/06 and look good ;)
  9.    GM
  10.       verb
  11.          announce(msg as text)
  12.             set desc = "Announce something to the world."
  13.             set category = "GM verbs"
  14.             world << "<font color =blue>([usr.name] announces): [msg]"
  15.       verb
  16.          world_inform(msg as text)
  17.             set desc = "Inform the world about something."
  18.             set category = "GM verbs"
  19.             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>"
  20.       verb
  21.          change_density()
  22.             set desc = "Change your density."
  23.             set category = "GM verbs"
  24.             if(density == 1)
  25.                density = 0 //doesn't matter, usr.density or density
  26.                usr << "You change your density to 0." //maybe a return statement below this?
  27.             else
  28.                density = 1
  29.                usr << "You change your density to 1." //maybe a return statement below this?
  30.       verb
  31.          change_your_name()
  32.             set desc = "Change your name."
  33.             set category = "GM verbs"
  34.             usr.names = input(usr,"What would you like your name to be changed to?","Name change",usr.names)
  35.             usr.name = usr.names
  36.             usr << "You changed your name to [usr.names]."
  37.       verb
  38.          change_mobs_name()
  39.             set desc = "Change the name of someone."
  40.             set category = "GM verbs"
  41.             set src in view(1)
  42.             if(src == usr)
  43.                return
  44.             else
  45.                var/their_new_name = input(usr,"You are changing [src.name]'s name.",src.name)
  46.                usr << "You changed [src.name]'s name to [their_new_name]."
  47.                src.name = their_new_name
  48.       verb
  49.          who()
  50.             var/tmp/count_mobs = 0 //does this variable have to be temporary?
  51.             set desc = "Who's in world?"
  52.             set category = "GM verbs"
  53.             if(already_clicked)
  54.                return
  55.             else
  56.                usr << "<font color =gray><TT>ƒƒƒƒƒƒ¤People currently in World¤ƒƒƒƒƒƒ</TT></font>"
  57.                var/mob/M
  58.                for(M in world){
  59.                   if(!M.key)
  60.                      continue
  61.                   else
  62.                      if(M.GM_powers)
  63.                         if(src.key == "DragonMasterGod")
  64.                            count_mobs++
  65.                            usr << "<font color = orange>(</font><font color =blue><b>MGM</b></font><font color = orange>)</font><font color = blue> [src.name]</font> Level <font color = green>\[</font><font color =gray>[src.level]</font><font color = green>\]</font><font color = purple>{</font>[src.key]<font color = purple>}</font>"
  66.                         else
  67.                            count_mobs++
  68.                            usr << "<font color = orange>(</font><font color =blue><b>GM</b></font><font color = orange>)</font><font color = blue> [src.name]</font> Level <font color = green>\[</font><font color =gray>[src.level]</font><font color = green>\]</font><font color = purple>{</font>[src.key]<font color = purple>}</font>"
  69.                      else
  70.                         count_mobs++
  71.                         usr << "<font color =blue>[src.name]</font> Level <font color =gray>[src.level]</font>"
  72.                      usr << "____Player count: [count_mobs]____"
  73.                      already_clicked = 1
  74.                      sleep(50)
  75.                      already_clicked = 0
  76.                      return
  77.  
  78.                      //if(usr == src) // may need to be changed
  79.                         //return
  80.                      //else
  81.                }
  82.       verb
  83.          set_health()
  84.             set desc = "Put your health to a lower state."
  85.             set category = "GM verbs"
  86.             lowering_health:
  87.             var/new_health = input(usr,"Your health?","Set Health",usr.maxHealth) as num
  88.             if(new_health <= 0)
  89.                usr << "Your health can't be a negative integer."
  90.                goto lowering_health
  91.             if(new_health > usr.maxHealth)
  92.                usr << "You're trying to cheat?  You're entitled to playing this game legit too."
  93.                goto lowering_health
  94.             else
  95.                new_health = round(new_health)
  96.                usr.health = new_health
  97.                usr << "You set your health to [new_health]."
  98.                return
  99.  
  100.  
  101.       verb
  102.          teleport(var/M as mob in world)
  103.             set desc = "Go to the location of someone."
  104.             set category = "GM verbs"
  105.             input(usr,"Who would you like to teleport to?","Teleport",M)
  106.             //M = teleported_to
  107.             usr << "[M]." //debugging code
  108.             if(M == usr)
  109.                usr << "You can not teleport to yourself."
  110.                usr << "[M]."
  111.                return
  112.             else
  113.                if(de_teleportx && de_teleporty && de_teleportz) // may need some testing
  114.                   teleported = 1
  115.                   usr << "[teleported]"
  116.                   usr.loc = get_step(M,SOUTH)
  117.                   usr << "You appear infront of [M]."
  118.                   M << "[usr.name] teleports infront of you."
  119.                else
  120.                   de_teleportx = x
  121.                   de_teleporty = y
  122.                   de_teleportz = z
  123.                   teleported = 1
  124.                   usr << "[teleported]"
  125.                   usr.loc = get_step(M,SOUTH)
  126.                   usr << "You appear infront of [M]."
  127.                   M << "[usr.name] teleports infront of you."
  128.       verb
  129.          de_teleport() // may need some more testing
  130.             set desc = "Go back to your original position."
  131.             set category = "GM verbs"
  132.             usr << "[teleported]"
  133.             if(teleported)
  134.                usr.loc = locate(de_teleportx, de_teleporty, de_teleportz)
  135.                usr << "You teleported back to your first location."
  136.                usr.de_teleportx = 0
  137.                usr.de_teleporty = 0
  138.                usr.de_teleportz = 0
  139.                teleported = 0
  140.             else
  141.                return
  142.  
  143.       verb
  144.          summon(var/M as mob in world) //tested and looks good
  145.             set desc = "Summon someone."
  146.             set category = "GM verbs"
  147.             input(usr,"Who would you like to summon?","Summon",M)
  148.             src = M
  149.             if(src == usr)
  150.                usr << "You can not summon yourself."
  151.                return
  152.             else // might need some more testing
  153.                src.already_summoned++
  154.                usr << "[src.already_summoned]"
  155.                if(src.already_summoned >= 2) // yet to be debugged
  156.                   //var/summon_again = input(usr,"This mob has already been summoned!","Again?") in list("Yes","No")
  157.                   //if(summon_again == "Yes")
  158.                   src.loc = get_step(usr,SOUTH)
  159.                   usr << "You summon [src.name]." // was M
  160.                   src << "You have been summoned by [usr.name]." // was M
  161.  
  162.                   //if(summon_again == "No")
  163.                      //usr << "You choose not to summon mob again."
  164.                      //return
  165.                   return
  166.                src.de_summonx = x
  167.                src.de_summony = y
  168.                src.de_summonz = z
  169.                usr << "[de_summonx], [de_summony], [de_summonz]"
  170.                src.summoned = 1
  171.                src.loc = get_step(usr,SOUTH)
  172.                usr << "You summon [src.name]." // was M
  173.                src << "You have been summoned by [usr.name]." // was M
  174.       verb //tested and looks good
  175.          de_summon() //might need some more testing // if this stays this way, all mobs infront will be unsummoned
  176.             set desc = "Send them back to their original position."
  177.             for(var/tmp/M as mob in get_step(usr,usr.dir))
  178.                set category = "GM verbs"
  179.                //input(usr,"Who would you like to desummon?","Desummoning",M)
  180.                src = M
  181.                //usr << "[src.summoned]" // debugging code
  182.                if(src.summoned)
  183.                   usr << "[de_summonx], [de_summony], [de_summonz]"
  184.                   src.loc = locate(src.de_summonx, src.de_summony, src.de_summonz)
  185.                   usr << "You desummoned [src.name]."
  186.                   src << "You have been placed back to your original location."
  187.                   src.summoned = 0
  188.                   src.already_summoned = 0
  189.                else
  190.                   usr << "This mob has not been summoned."
  191.                   return
  192.       verb
  193.          get_location(var/M as mob in world)
  194.             set desc = "Get the location of someone."
  195.             set category = "GM verbs"
  196.             input(usr,"Whos location would you like to get?","Getting location",M)
  197.             src = M
  198.             usr << "[src.x], [src.y], [src.z]"
  199.       verb
  200.          mute_player() //needs work
  201.             set desc = "Mute a player in the world."
  202.             set category = "GM verbs"
  203.             whoToMute = input(usr,"Who you gonna mute?","Muting whom?") in players
  204.             whoToMute.choiceOfMute = input(usr,"How long do you wish to mute this person?","Length of Mute") in list ("Seconds","Minutes","Hours","Days","Permanently","Nevermind")
  205.             if(whoToMute.choiceOfMute == "Seconds")
  206.                whoToMute.durationOfMute = input(usr,"How many seconds do you wish to mute [M]?","Seconds",whoToMute.durationOfMute) as num
  207.                whoToMute.durationOfMute *= 10
  208.                whoToMute << "You have been muted for [whoToMute.durationOfMute / 10] second\s."
  209.             if(whoToMute.choiceOfMute == "Minutes")
  210.                whoToMute.durationOfMute = input(usr,"How many minutes do you wish to mute [M]?","Minutes",whoToMute.durationOfMute) as num
  211.                whoToMute.durationOfMute *= 600
  212.                whoToMute << "You have been muted for [whoToMute.durationOfMute / 600] minute\s."
  213.             if(whoToMute.choiceOfMute == "Hours")
  214.                whoToMute.durationOfMute = input(usr,"How many hours do you wish to mute [M]?","Hours",whoToMute.durationOfMute) as num
  215.                whoToMute.durationOfMute *= 36000
  216.                whoToMute << "You have been muted for [whoToMute.durationOfMute / 36000] hour\s."
  217.             if(whoToMute.choiceOfMute == "Days")
  218.                whoToMute.durationOfMute = input(usr,"How many days do you wish to mute [M]?","Days",whoToMute.durationOfMute) as num
  219.                whoToMute.durationOfMute *= 864000
  220.                whoToMute << "You have been muted for [whoToMute.durationOfMute / 864000] day\s."
  221.             if(whoToMute.choiceOfMute == "Permanently")
  222.                whoToMute.durationOfMute = 1000000000000 * 75
  223.                whoToMute << "You have been muted indefinately."
  224.             whoToMute.verbs -= /mob/verb/say
  225.             whoToMute.muted = 1
  226.             src.overlays += image('overlayicons.dmi',icon_state = "Muted")
  227.             sleep(whoToMute.durationOfMute)
  228.             whoToMute << "Your mute duration is over.  You may now speak."
  229.             whoToMute.verbs += /mob/verb/say
  230.             src.overlays -= image('overlayicons.dmi',icon_state = "Muted")
  231.             whoToMute.muted = 0
  232.       verb
  233.          get_health()
  234.             set desc = "Get a mob's health."
  235.             set category = "GM verbs"
  236.             set src in oview(1)
  237.             usr << "[src]'s health is at [src.health]."
  238.  
  239. client/var/muted = 0
  240. client/var/choiceOfMute = 0
  241. client/var/durationOfMute = 0
  242. var/client/whoToMute
  243. var/players = list("Nothing")
  244. client/New()
  245.    players += src
  246.    return ..()
  247. /*
  248.                if(M.muted)
  249.                   if(M.choiceOfMute == "Seconds")
  250.                      Moderator << "[M] is already muted for \a [M.durationOfMute / 10] second\s."
  251.                      break
  252.                   if(M.choiceOfMute == "Minutes")
  253.                      Moderator << "[M] is already muted for \a [M.durationOfMute / 600] minute\s."
  254.                      break
  255.                   if(M.choiceOfMute == "Hours")
  256.                      Moderator << "[M] is already muted for \an [M.durationOfMute / 36000] hour\s."
  257.                      break
  258.                   if(M.choiceOfMute == "Days")
  259.                      Moderator << "[M] is already muted for \a [M.durationOfMute / 864000] day\s."
  260.                      break
  261.                */
  262.  
  263.  
  264.  
  265.  
  266. mob
  267.    MegaGM
  268.       verb
  269.          make_GM()
  270.             set desc = "Give GM powers."
  271.             set src in world
  272.             if(src == usr && src.GM_powers)
  273.                usr << "You're already a GM."
  274.                return
  275.             if(!src.GM_powers) //might have to make a for loop saying for(M as mob in oview()) and make it so it
  276.                set category = "GM verbs" //checks if they have a key or not to establish if they're able to recieve
  277.                if(src == usr && !src.GM_powers) //the GM powers or not.  Same applies for the Take_GM verb except
  278.                   usr << "You make yourself a GM." //vice-versa.
  279.                   usr.verbs += typesof(/mob/GM/verb)
  280.                   usr.GM_powers = 1
  281.                else
  282.                   usr = input(usr,"Who would you like to make a GM?","Make GM",src)
  283.                   src.verbs += typesof(/mob/GM/verb)
  284.                   src.GM_powers = 1
  285.                   src << "You have been given GM powers."
  286.             if(src.GM_powers && src != usr)
  287.                usr << "This person already has GM powers."
  288.                return
  289.  
  290.       verb
  291.          take_GM()
  292.             set desc = "Take the GM powers away."
  293.             if(src.GM_powers) // if this doesn't work, try src.GM_powers == 1
  294.                set category = "GM verbs"
  295.                set src in world
  296.                if(src == usr)
  297.                   var/take_away_own = input(usr,"Do you want to take away your own GM power?") in list ("Yes","No")
  298.                   if(take_away_own == "Yes")
  299.                      usr.verbs -= typesof(/mob/GM/verb)
  300.                      usr.GM_powers = 0
  301.                      usr << "Your GM powers have been taken away."
  302.                   if(take_away_own == "No")
  303.                      usr << "You decide not to take away your own GM powers."
  304.                      return
  305.                else
  306.                   usr = input(usr,"Who would you like to take GM away from?","Take GM",src)
  307.                   src.verbs -= typesof(/mob/GM/verb)
  308.                   src.GM_powers = 0
  309.                   src << "Your GM powers have been taken away."
  310.             else
  311.                usr << "This person does not have GM powers."
  312.                return
  313.          world_blessing()
  314.             set category = "GM verbs"
  315.             set desc = "Bless the people of the world with an aura of healing refreshment."
  316.             var/mob/S
  317.             for(S in world){
  318.                if(!S.key) continue
  319.                else
  320.                   S.overlays += image('blessed.dmi')
  321.                   S.health = S.maxHealth
  322.                   if(S == usr)
  323.                      S << "<font color = yellow>You bless yourself.</font>"
  324.                   else
  325.                      S << "<font color = yellow>A <b>GM</b> has blessed you.</font>"
  326.                   sleep(10)
  327.                   S.overlays -= image('blessed.dmi')
  328.                   S << "<font color = yellow>You are now at full health.</font>"
  329.             }
  330.          create()
  331.             set category = "GM verbs"
  332.             set desc = "Create something that you want."
  333.             var/create = input(usr,"Create something at will.","What to create?") in objects //was commented out
  334.             if(create == "Nothing")
  335.                usr << "You created nothing."
  336.                return
  337.             else
  338.                usr << "You created \an [create]."
  339.                new create:type(usr.loc)
  340.          destroy(var/T as area|turf|obj|mob in oview()) //view() for self and everything, oview() for everything else besides you
  341.             set category = "GM verbs"
  342.             set desc = "Destroy something."
  343.             missile(/obj/trailexplosion, usr, T)
  344.             usr << "You destroyed [T]."
  345.             sleep(10)
  346.             T:overlays += image('explosion.dmi') //look for a better explosion icon
  347.             spawn(10)
  348.             del T
  349.             /*
  350.          amaze_health() //this verb isn't needed, it's only for debugging purposes.  Will be deleted.
  351.             set desc = "Amaze your max health."
  352.             set category = "GM verbs"
  353.             amazing_health:
  354.             var/amaze_health = input(usr,"Your health?","Amaze Health",usr.maxHealth) as num
  355.             if(amaze_health <= 0)
  356.                usr << "Your health can't be a negative integer."
  357.                goto amazing_health
  358.             else
  359.                amaze_health = round(amaze_health)
  360.                usr.maxHealth = amaze_health
  361.                usr << "You set your health to [amaze_health]."
  362.                return
  363. */
  364.  
  365. obj
  366.    trailexplosion
  367.       icon = 'trailtoE.dmi'
  368.    explosion
  369.       icon = 'explosion.dmi'
  370. var/objects[0]
  371. world/New()
  372.    var/M
  373.    for(M in typesof(/obj, /mob/npc, /area))
  374.       objects += new M
  375.    objects += "Nothing"
Advertisement
Add Comment
Please, Sign In to add comment