Advertisement
GuyWithAmp

Ponerland Source

Jun 28th, 2016
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 27.91 KB | None | 0 0
  1. ---- Ponerland.cs ----
  2.  
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.IO;
  9. using Discord;
  10.  
  11. namespace DiscordBot.Commands
  12. {
  13.     class PonerLand
  14.     {
  15.         //PonerName Food Cleanliness Mood Level
  16.  
  17.         public static void Tick()
  18.         {
  19.             StreamReader sr = new StreamReader("PonerLand.txt");
  20.             List<string> names = new List<string>();
  21.             while(!sr.EndOfStream)
  22.             {
  23.                 names.Add(sr.ReadLine().Split()[0]);
  24.             }
  25.             sr.Close();
  26.             foreach (string name in names)
  27.             {
  28.                 AddStat(name, 1, -1);
  29.                 AddStat(name, 2, -1);
  30.                 AddStat(name, 3, 6);
  31.                 AddStat(name, 4, 1);
  32.             }
  33.         }
  34.  
  35.         public static void AddStat(string poner, int stat, int value)
  36.         {
  37.             SetStat(poner, stat, GetStat(poner, stat) + value);
  38.         }
  39.  
  40.         public static void SetStat(string poner, int stat, int value)
  41.         {
  42.             bool ded = false;
  43.             List<string> list = new List<string>();
  44.             StreamReader sr = new StreamReader("PonerLand.txt");
  45.             while(!sr.EndOfStream)
  46.             {
  47.                 list.Add(sr.ReadLine());
  48.             }
  49.             sr.Close();
  50.             StreamWriter sw = new StreamWriter("PonerLand.txt");
  51.             foreach(string token in list)
  52.             {
  53.                 if(token.StartsWith(poner, true, System.Globalization.CultureInfo.CurrentCulture))
  54.                 {
  55.                     string[] ponerString = token.Split();
  56.                     int[] ponerStats = new int[ponerString.Length - 1];
  57.                     for(int i = 1; i < ponerString.Length; i++)
  58.                     {
  59.                         ponerStats[i - 1] = int.Parse(ponerString[i]);
  60.                     }
  61.                     ponerStats[stat - 1] = value;
  62.                     if (ponerStats[stat - 1] > 100) ponerStats[stat - 1] = 100;
  63.                     if (ponerStats[stat - 1] <= 0) ded = true;
  64.                     sw.WriteLine("{0} {1}", poner, string.Join(" ", ponerStats));
  65.                 }
  66.                 else
  67.                 {
  68.                     sw.WriteLine(token);
  69.                 }
  70.             }
  71.             sw.Close();
  72.             if (ded) Kill(poner);
  73.         }
  74.  
  75.         public static bool IsPoner(string poner)
  76.         {
  77.             StreamReader sr = new StreamReader("PonerLand.txt");
  78.             while (!sr.EndOfStream)
  79.             {
  80.                 string line = sr.ReadLine();
  81.                 if (line.StartsWith(poner, true, System.Globalization.CultureInfo.CurrentCulture))
  82.                 {
  83.                     sr.Close();
  84.                     return true;
  85.                 }
  86.             }
  87.             sr.Close();
  88.             return false;
  89.         }
  90.  
  91.         public static bool IsDedPoner(string poner)
  92.         {
  93.             StreamReader sr = new StreamReader("PonerGraveyard.txt");
  94.             while (!sr.EndOfStream)
  95.             {
  96.                 string line = sr.ReadLine();
  97.                 if (line.StartsWith(poner, true, System.Globalization.CultureInfo.CurrentCulture))
  98.                 {
  99.                     sr.Close();
  100.                     return true;
  101.                 }
  102.             }
  103.             sr.Close();
  104.             return false;
  105.         }
  106.  
  107.         public static string Boop(string poner, string user)
  108.         {
  109.             if (IsPoner(poner))
  110.             {
  111.                 bool ded = (GetStat(poner, 3) - 2 <= 0);
  112.                 AddStat(poner, 3, -2);
  113.                 if (ded)
  114.                 {
  115.                     return string.Format("Congratulations. You booped {0} to death. Are you proud of yourself?", poner);
  116.                 }
  117.                 else
  118.                 {
  119.                     return string.Format("{0}: [scrunch]", poner);
  120.                 }
  121.             }
  122.             else
  123.             {
  124.                 if(IsDedPoner(poner))
  125.                 {
  126.                     return string.Format("You can't boop the dead, {0}.", user);
  127.                 }
  128.                 else
  129.                 {
  130.                     return poner + " does not exists in Ponyland.";
  131.                 }
  132.             }
  133.            
  134.         }
  135.  
  136.         public static string Brushie(string poner, string user)
  137.         {
  138.             if (IsPoner(poner))
  139.             {
  140.                 if (GetStat(poner, 2) > 80)
  141.                 {
  142.                     if (GetStat(poner, 2) > 95)
  143.                     {
  144.                         AddStat(poner, 2, 2);
  145.                         bool ded = (GetStat(poner, 3) - 5 <= 0);
  146.                         AddStat(poner, 3, -5);
  147.                         if (ded)
  148.                         {
  149.                             return string.Format("You brushed {0} to death. Are you happy?", poner);
  150.                         }
  151.                         return string.Format("{0}: \"Stop brushing me!\"", poner);
  152.                     }
  153.                         Random r = new Random();
  154.  
  155.                     if (r.Next(2) < 1)
  156.                     {
  157.                         AddStat(poner, 2, 5);
  158.                         return string.Format("[pleased {0} noises]", poner);
  159.                     }
  160.                     else
  161.                     {
  162.                         AddStat(poner, 2, 2);
  163.                         bool ded = (GetStat(poner, 3) - 3 <= 0);
  164.                         AddStat(poner, 3, -3);
  165.                         if (ded)
  166.                         {
  167.                             return string.Format("You brushed {0} to death. Are you happy?", poner);
  168.                         }
  169.                         return string.Format("{0}: \"I'm clean enough, stop brushing me.\"", poner);
  170.                     }
  171.                 }
  172.                 else {
  173.                     AddStat(poner, 2, 10);
  174.                     return string.Format("[pleased {0} noises]", poner);
  175.                 }
  176.             }
  177.             else
  178.             {
  179.                 if (IsDedPoner(poner))
  180.                 {
  181.                     return string.Format("You can't brush the dead, {0}.", user);
  182.                 }
  183.                 else
  184.                 {
  185.                     return poner + " does not exists in Ponyland.";
  186.                 }
  187.             }
  188.  
  189.         }
  190.  
  191.         public static string Feed(string poner, string user)
  192.         {
  193.             if (IsPoner(poner))
  194.             {
  195.                 if (GetStat(poner, 1) > 80)
  196.                 {
  197.                     if (GetStat(poner, 1) > 95)
  198.                     {
  199.                         AddStat(poner, 1, 5);
  200.                         bool ded = (GetStat(poner, 3) - 5 <= 0);
  201.                         AddStat(poner, 3, -5);
  202.                         if (ded)
  203.                         {
  204.                             return string.Format("You fed {0} to death.", poner);
  205.                         }
  206.                         return string.Format("{0}: \"I don't want your food!\"", poner);
  207.                     }
  208.                     Random r = new Random();
  209.  
  210.                     if (r.Next(2) < 1)
  211.                     {
  212.                         AddStat(poner, 1, 10);
  213.                         return string.Format("[pleased {0} noises]", poner);
  214.                     }
  215.                     else
  216.                     {
  217.  
  218.                         return string.Format("{0}: \"I'm full. I don't need your food.\"", poner);
  219.                     }
  220.                 }
  221.                 else {
  222.                     AddStat(poner, 1, 15);
  223.                     return string.Format("[pleased {0} noises]", poner);
  224.                 }
  225.             }
  226.             else
  227.             {
  228.                 if (IsDedPoner(poner))
  229.                 {
  230.                     return string.Format("You can't feed corpses, {0}.", user);
  231.                 }
  232.                 else
  233.                 {
  234.                     return poner + " does not exists in Ponyland.";
  235.                 }
  236.             }
  237.  
  238.         }
  239.  
  240.         public static int GetStat(string poner, int stat)
  241.         {
  242.             StreamReader sr = new StreamReader("PonerLand.txt");
  243.             while(!sr.EndOfStream)
  244.             {
  245.                 string line = sr.ReadLine();
  246.                 if(line.StartsWith(poner, true, System.Globalization.CultureInfo.CurrentCulture))
  247.                 {
  248.                     sr.Close();
  249.                     return int.Parse(line.Split()[stat]);
  250.                 }
  251.             }
  252.             sr.Close();
  253.             return 0;
  254.         }
  255.  
  256.         public static int GetCount()
  257.         {
  258.             return 0;
  259.         }
  260.  
  261.         public static string[] GetPoners()
  262.         {
  263.             List<string> list = new List<string>();
  264.             StreamReader sr = new StreamReader("PonerLand.txt");
  265.             while(!sr.EndOfStream)
  266.             {
  267.                 string[] ponerData = sr.ReadLine().Split();
  268.                 list.Add(string.Format("[{0}] {2}% Full, {1}% Clean, {3}% Happy, Level {4}.", ponerData[0], ponerData[2], ponerData[1], ponerData[3], ponerData[4]));
  269.             }
  270.             sr.Close();
  271.             return list.ToArray();
  272.         }
  273.  
  274.         public static void NewPoner(string poner, Message message)
  275.         {
  276.             if(IsPoner(poner))
  277.             {
  278.                 message.Channel.SendMessage(poner + " already exists!");
  279.                 return;
  280.             }
  281.             if (IsDedPoner(poner))
  282.             {
  283.                 message.Channel.SendMessage(poner + " is dead. Just accept it.");
  284.                 return;
  285.             }
  286.             StreamWriter sw = new StreamWriter("PonerLand.txt", true);
  287.             sw.WriteLine(poner + " 80 80 80 0");
  288.             sw.Close();
  289.             message.Channel.SendMessage(poner + " has been brought to Ponyland!");
  290.         }
  291.  
  292.         public static string GetCleanliness(int clean)
  293.         {
  294.             if (clean < 5)
  295.                 return "Extremely filthy";
  296.             else if (clean < 25)
  297.                 return "Filthy";
  298.             else if (clean < 50)
  299.                 return "Dirty";
  300.             else if (clean < 75)
  301.                 return "Rough";
  302.             else if (clean < 95)
  303.                 return "Clean";
  304.             else return "Spotless";
  305.         }
  306.  
  307.         public static string GetHunger(int food)
  308.         {
  309.             if (food < 5)
  310.                 return "Famished";
  311.             else if (food < 25)
  312.                 return "Starving";
  313.             else if (food < 50)
  314.                 return "Hungry";
  315.             else if (food < 75)
  316.                 return "Satistfied";
  317.             else if (food < 95)
  318.                 return "Full";
  319.             else return "Stuffed";
  320.         }
  321.  
  322.         public static string GetHappiness(int happy)
  323.         {
  324.             if (happy < 5)
  325.                 return "Flaming";
  326.             else if (happy < 15)
  327.                 return "Raging";
  328.             else if (happy < 30)
  329.                 return "Angry";
  330.             else if (happy < 45)
  331.                 return "Perturbed";
  332.             else if (happy < 75)
  333.                 return "Calm";
  334.             else return "Happy";
  335.         }
  336.  
  337.         public static void Kill(string poner)
  338.         {
  339.             List<string> list = new List<string>();
  340.             StreamReader sr = new StreamReader("PonerLand.txt");
  341.             while (!sr.EndOfStream)
  342.             {
  343.                 list.Add(sr.ReadLine());
  344.             }
  345.             sr.Close();
  346.             StreamWriter sw = new StreamWriter("PonerLand.txt");
  347.             foreach (string token in list)
  348.             {
  349.                 if (!token.Contains(poner))
  350.                 {
  351.                     sw.WriteLine(token);
  352.                 }
  353.             }
  354.             StreamWriter graveyard = new StreamWriter("PonerGraveyard.txt", true);
  355.             graveyard.WriteLine("\n" + poner);
  356.             sw.Close();
  357.             graveyard.Close();
  358.         }
  359.  
  360.         public static string[] GetDed()
  361.         {
  362.             List<string> list = new List<string>();
  363.             StreamReader sr = new StreamReader("PonerGraveyard.txt");
  364.             while (!sr.EndOfStream)
  365.             {
  366.                 list.Add(string.Format("[{0}]", sr.ReadLine()));
  367.             }
  368.             sr.Close();
  369.             return list.ToArray();
  370.         }
  371.     }
  372. }
  373.  
  374. ---- The code that goes in the command switch statement in Program.cs ----
  375.  
  376.                                 ---- Ponerland.cs -------- Ponerland.cs ----
  377.  
  378. using System;
  379. using System.Collections.Generic;
  380. using System.Linq;
  381. using System.Text;
  382. using System.Threading.Tasks;
  383. using System.IO;
  384. using Discord;
  385.  
  386. namespace DiscordBot.Commands
  387. {
  388.     class PonerLand
  389.     {
  390.         //PonerName Food Cleanliness Mood Level
  391.  
  392.         public static void Tick()
  393.         {
  394.             StreamReader sr = new StreamReader("PonerLand.txt");
  395.             List<string> names = new List<string>();
  396.             while(!sr.EndOfStream)
  397.             {
  398.                 names.Add(sr.ReadLine().Split()[0]);
  399.             }
  400.             sr.Close();
  401.             foreach (string name in names)
  402.             {
  403.                 AddStat(name, 1, -1);
  404.                 AddStat(name, 2, -1);
  405.                 AddStat(name, 3, 6);
  406.                 AddStat(name, 4, 1);
  407.             }
  408.         }
  409.  
  410.         public static void AddStat(string poner, int stat, int value)
  411.         {
  412.             SetStat(poner, stat, GetStat(poner, stat) + value);
  413.         }
  414.  
  415.         public static void SetStat(string poner, int stat, int value)
  416.         {
  417.             bool ded = false;
  418.             List<string> list = new List<string>();
  419.             StreamReader sr = new StreamReader("PonerLand.txt");
  420.             while(!sr.EndOfStream)
  421.             {
  422.                 list.Add(sr.ReadLine());
  423.             }
  424.             sr.Close();
  425.             StreamWriter sw = new StreamWriter("PonerLand.txt");
  426.             foreach(string token in list)
  427.             {
  428.                 if(token.StartsWith(poner, true, System.Globalization.CultureInfo.CurrentCulture))
  429.                 {
  430.                     string[] ponerString = token.Split();
  431.                     int[] ponerStats = new int[ponerString.Length - 1];
  432.                     for(int i = 1; i < ponerString.Length; i++)
  433.                     {
  434.                         ponerStats[i - 1] = int.Parse(ponerString[i]);
  435.                     }
  436.                     ponerStats[stat - 1] = value;
  437.                     if (ponerStats[stat - 1] > 100) ponerStats[stat - 1] = 100;
  438.                     if (ponerStats[stat - 1] <= 0) ded = true;
  439.                     sw.WriteLine("{0} {1}", poner, string.Join(" ", ponerStats));
  440.                 }
  441.                 else
  442.                 {
  443.                     sw.WriteLine(token);
  444.                 }
  445.             }
  446.             sw.Close();
  447.             if (ded) Kill(poner);
  448.         }
  449.  
  450.         public static bool IsPoner(string poner)
  451.         {
  452.             StreamReader sr = new StreamReader("PonerLand.txt");
  453.             while (!sr.EndOfStream)
  454.             {
  455.                 string line = sr.ReadLine();
  456.                 if (line.StartsWith(poner, true, System.Globalization.CultureInfo.CurrentCulture))
  457.                 {
  458.                     sr.Close();
  459.                     return true;
  460.                 }
  461.             }
  462.             sr.Close();
  463.             return false;
  464.         }
  465.  
  466.         public static bool IsDedPoner(string poner)
  467.         {
  468.             StreamReader sr = new StreamReader("PonerGraveyard.txt");
  469.             while (!sr.EndOfStream)
  470.             {
  471.                 string line = sr.ReadLine();
  472.                 if (line.StartsWith(poner, true, System.Globalization.CultureInfo.CurrentCulture))
  473.                 {
  474.                     sr.Close();
  475.                     return true;
  476.                 }
  477.             }
  478.             sr.Close();
  479.             return false;
  480.         }
  481.  
  482.         public static string Boop(string poner, string user)
  483.         {
  484.             if (IsPoner(poner))
  485.             {
  486.                 bool ded = (GetStat(poner, 3) - 2 <= 0);
  487.                 AddStat(poner, 3, -2);
  488.                 if (ded)
  489.                 {
  490.                     return string.Format("Congratulations. You booped {0} to death. Are you proud of yourself?", poner);
  491.                 }
  492.                 else
  493.                 {
  494.                     return string.Format("{0}: [scrunch]", poner);
  495.                 }
  496.             }
  497.             else
  498.             {
  499.                 if(IsDedPoner(poner))
  500.                 {
  501.                     return string.Format("You can't boop the dead, {0}.", user);
  502.                 }
  503.                 else
  504.                 {
  505.                     return poner + " does not exists in Ponyland.";
  506.                 }
  507.             }
  508.            
  509.         }
  510.  
  511.         public static string Brushie(string poner, string user)
  512.         {
  513.             if (IsPoner(poner))
  514.             {
  515.                 if (GetStat(poner, 2) > 80)
  516.                 {
  517.                     if (GetStat(poner, 2) > 95)
  518.                     {
  519.                         AddStat(poner, 2, 2);
  520.                         bool ded = (GetStat(poner, 3) - 5 <= 0);
  521.                         AddStat(poner, 3, -5);
  522.                         if (ded)
  523.                         {
  524.                             return string.Format("You brushed {0} to death. Are you happy?", poner);
  525.                         }
  526.                         return string.Format("{0}: \"Stop brushing me!\"", poner);
  527.                     }
  528.                         Random r = new Random();
  529.  
  530.                     if (r.Next(2) < 1)
  531.                     {
  532.                         AddStat(poner, 2, 5);
  533.                         return string.Format("[pleased {0} noises]", poner);
  534.                     }
  535.                     else
  536.                     {
  537.                         AddStat(poner, 2, 2);
  538.                         bool ded = (GetStat(poner, 3) - 3 <= 0);
  539.                         AddStat(poner, 3, -3);
  540.                         if (ded)
  541.                         {
  542.                             return string.Format("You brushed {0} to death. Are you happy?", poner);
  543.                         }
  544.                         return string.Format("{0}: \"I'm clean enough, stop brushing me.\"", poner);
  545.                     }
  546.                 }
  547.                 else {
  548.                     AddStat(poner, 2, 10);
  549.                     return string.Format("[pleased {0} noises]", poner);
  550.                 }
  551.             }
  552.             else
  553.             {
  554.                 if (IsDedPoner(poner))
  555.                 {
  556.                     return string.Format("You can't brush the dead, {0}.", user);
  557.                 }
  558.                 else
  559.                 {
  560.                     return poner + " does not exists in Ponyland.";
  561.                 }
  562.             }
  563.  
  564.         }
  565.  
  566.         public static string Feed(string poner, string user)
  567.         {
  568.             if (IsPoner(poner))
  569.             {
  570.                 if (GetStat(poner, 1) > 80)
  571.                 {
  572.                     if (GetStat(poner, 1) > 95)
  573.                     {
  574.                         AddStat(poner, 1, 5);
  575.                         bool ded = (GetStat(poner, 3) - 5 <= 0);
  576.                         AddStat(poner, 3, -5);
  577.                         if (ded)
  578.                         {
  579.                             return string.Format("You fed {0} to death.", poner);
  580.                         }
  581.                         return string.Format("{0}: \"I don't want your food!\"", poner);
  582.                     }
  583.                     Random r = new Random();
  584.  
  585.                     if (r.Next(2) < 1)
  586.                     {
  587.                         AddStat(poner, 1, 10);
  588.                         return string.Format("[pleased {0} noises]", poner);
  589.                     }
  590.                     else
  591.                     {
  592.  
  593.                         return string.Format("{0}: \"I'm full. I don't need your food.\"", poner);
  594.                     }
  595.                 }
  596.                 else {
  597.                     AddStat(poner, 1, 15);
  598.                     return string.Format("[pleased {0} noises]", poner);
  599.                 }
  600.             }
  601.             else
  602.             {
  603.                 if (IsDedPoner(poner))
  604.                 {
  605.                     return string.Format("You can't feed corpses, {0}.", user);
  606.                 }
  607.                 else
  608.                 {
  609.                     return poner + " does not exists in Ponyland.";
  610.                 }
  611.             }
  612.  
  613.         }
  614.  
  615.         public static int GetStat(string poner, int stat)
  616.         {
  617.             StreamReader sr = new StreamReader("PonerLand.txt");
  618.             while(!sr.EndOfStream)
  619.             {
  620.                 string line = sr.ReadLine();
  621.                 if(line.StartsWith(poner, true, System.Globalization.CultureInfo.CurrentCulture))
  622.                 {
  623.                     sr.Close();
  624.                     return int.Parse(line.Split()[stat]);
  625.                 }
  626.             }
  627.             sr.Close();
  628.             return 0;
  629.         }
  630.  
  631.         public static int GetCount()
  632.         {
  633.             return 0;
  634.         }
  635.  
  636.         public static string[] GetPoners()
  637.         {
  638.             List<string> list = new List<string>();
  639.             StreamReader sr = new StreamReader("PonerLand.txt");
  640.             while(!sr.EndOfStream)
  641.             {
  642.                 string[] ponerData = sr.ReadLine().Split();
  643.                 list.Add(string.Format("[{0}] {2}% Full, {1}% Clean, {3}% Happy, Level {4}.", ponerData[0], ponerData[2], ponerData[1], ponerData[3], ponerData[4]));
  644.             }
  645.             sr.Close();
  646.             return list.ToArray();
  647.         }
  648.  
  649.         public static void NewPoner(string poner, Message message)
  650.         {
  651.             if(IsPoner(poner))
  652.             {
  653.                 message.Channel.SendMessage(poner + " already exists!");
  654.                 return;
  655.             }
  656.             if (IsDedPoner(poner))
  657.             {
  658.                 message.Channel.SendMessage(poner + " is dead. Just accept it.");
  659.                 return;
  660.             }
  661.             StreamWriter sw = new StreamWriter("PonerLand.txt", true);
  662.             sw.WriteLine(poner + " 80 80 80 0");
  663.             sw.Close();
  664.             message.Channel.SendMessage(poner + " has been brought to Ponyland!");
  665.         }
  666.  
  667.         public static string GetCleanliness(int clean)
  668.         {
  669.             if (clean < 5)
  670.                 return "Extremely filthy";
  671.             else if (clean < 25)
  672.                 return "Filthy";
  673.             else if (clean < 50)
  674.                 return "Dirty";
  675.             else if (clean < 75)
  676.                 return "Rough";
  677.             else if (clean < 95)
  678.                 return "Clean";
  679.             else return "Spotless";
  680.         }
  681.  
  682.         public static string GetHunger(int food)
  683.         {
  684.             if (food < 5)
  685.                 return "Famished";
  686.             else if (food < 25)
  687.                 return "Starving";
  688.             else if (food < 50)
  689.                 return "Hungry";
  690.             else if (food < 75)
  691.                 return "Satistfied";
  692.             else if (food < 95)
  693.                 return "Full";
  694.             else return "Stuffed";
  695.         }
  696.  
  697.         public static string GetHappiness(int happy)
  698.         {
  699.             if (happy < 5)
  700.                 return "Flaming";
  701.             else if (happy < 15)
  702.                 return "Raging";
  703.             else if (happy < 30)
  704.                 return "Angry";
  705.             else if (happy < 45)
  706.                 return "Perturbed";
  707.             else if (happy < 75)
  708.                 return "Calm";
  709.             else return "Happy";
  710.         }
  711.  
  712.         public static void Kill(string poner)
  713.         {
  714.             List<string> list = new List<string>();
  715.             StreamReader sr = new StreamReader("PonerLand.txt");
  716.             while (!sr.EndOfStream)
  717.             {
  718.                 list.Add(sr.ReadLine());
  719.             }
  720.             sr.Close();
  721.             StreamWriter sw = new StreamWriter("PonerLand.txt");
  722.             foreach (string token in list)
  723.             {
  724.                 if (!token.Contains(poner))
  725.                 {
  726.                     sw.WriteLine(token);
  727.                 }
  728.             }
  729.             StreamWriter graveyard = new StreamWriter("PonerGraveyard.txt", true);
  730.             graveyard.WriteLine("\n" + poner);
  731.             sw.Close();
  732.             graveyard.Close();
  733.         }
  734.  
  735.         public static string[] GetDed()
  736.         {
  737.             List<string> list = new List<string>();
  738.             StreamReader sr = new StreamReader("PonerGraveyard.txt");
  739.             while (!sr.EndOfStream)
  740.             {
  741.                 list.Add(string.Format("[{0}]", sr.ReadLine()));
  742.             }
  743.             sr.Close();
  744.             return list.ToArray();
  745.         }
  746.     }
  747. }
  748.  
  749. ----- The code that goes in the command switch statement in Program.cs ----
  750.  
  751.                             case "boop":
  752.                             case "newspaper":
  753.                                 if (command.Length > 1)
  754.                                 {
  755.                                     if(command[1] != "")
  756.                                     {
  757.                                         if(command[1].ToLower() == "dicey")
  758.                                         {
  759.                                             e.Channel.SendMessage("[scrunch]");
  760.                                         }
  761.                                         e.Channel.SendMessage(PonerLand.Boop(command[1].ToLower(), e.Message.User.Nickname));
  762.                                     }
  763.                                 }
  764.                                 else
  765.                                 {
  766.                                     e.Channel.SendMessage("[scrunch]");
  767.                                 }
  768.                                 break;
  769.                             case "brushie":
  770.                                 if (command.Length > 1)
  771.                                 {
  772.                                     if (command[1] != "")
  773.                                     {
  774.                                         if (command[1].ToLower() == "dicey")
  775.                                         {
  776.                                             e.Channel.SendMessage("[pleased dicey noises]");
  777.                                         }
  778.                                         e.Channel.SendMessage(PonerLand.Brushie(command[1].ToLower(), e.Message.User.Nickname));
  779.                                     }
  780.                                 }
  781.                                 else
  782.                                 {
  783.                                     e.Channel.SendMessage("[pleased dicey noises]");
  784.                                 }
  785.                                 break;
  786.                             case "feed":
  787.                                 if (command.Length > 1)
  788.                                 {
  789.                                     if (command[1] != "")
  790.                                     {
  791.                                         if (command[1].ToLower() == "dicey")
  792.                                         {
  793.                                             e.Channel.SendMessage("");
  794.                                         }
  795.                                         e.Channel.SendMessage(PonerLand.Feed(command[1].ToLower(), e.Message.User.Nickname));
  796.                                     }
  797.                                 }
  798.                                 else
  799.                                 {
  800.                                     e.Channel.SendMessage("[pleased dicey noises]");
  801.                                 }
  802.                                 break;
  803.                             case "ponies":
  804.                             case "poners":
  805.                                 e.Channel.SendMessage("```" + string.Join("\n", PonerLand.GetPoners()) + "```");
  806.                                 break;
  807.                             case "new":
  808.                                 if (command.Length > 1)
  809.                                 {
  810.                                     PonerLand.NewPoner(command[1], e.Message);
  811.                                 }
  812.                                 break;
  813.                             case "ded":
  814.                             case "dead":
  815.                                 e.Channel.SendMessage("```" + string.Join(", ", PonerLand.GetDed()) + "```");
  816.                                 break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement