aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tools/pCampBot/Behaviours/PhysicsBehaviour.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Tools/pCampBot/Behaviours/PhysicsBehaviour.cs31
1 files changed, 15 insertions, 16 deletions
diff --git a/OpenSim/Tools/pCampBot/Behaviours/PhysicsBehaviour.cs b/OpenSim/Tools/pCampBot/Behaviours/PhysicsBehaviour.cs
index 25529d0..daa7485 100644
--- a/OpenSim/Tools/pCampBot/Behaviours/PhysicsBehaviour.cs
+++ b/OpenSim/Tools/pCampBot/Behaviours/PhysicsBehaviour.cs
@@ -40,42 +40,41 @@ namespace pCampBot
40 /// <remarks> 40 /// <remarks>
41 /// TODO: talkarray should be in a separate behaviour. 41 /// TODO: talkarray should be in a separate behaviour.
42 /// </remarks> 42 /// </remarks>
43 public class PhysicsBehaviour : IBehaviour 43 public class PhysicsBehaviour : AbstractBehaviour
44 { 44 {
45 public string Name { get { return "Physics"; } }
46
47 private string[] talkarray; 45 private string[] talkarray;
48 46
49 public PhysicsBehaviour() 47 public PhysicsBehaviour()
50 { 48 {
49 Name = "Physics";
51 talkarray = readexcuses(); 50 talkarray = readexcuses();
52 } 51 }
53 52
54 public void Action(Bot bot) 53 public override void Action()
55 { 54 {
56 int walkorrun = bot.Random.Next(4); // Randomize between walking and running. The greater this number, 55 int walkorrun = Bot.Random.Next(4); // Randomize between walking and running. The greater this number,
57 // the greater the bot's chances to walk instead of run. 56 // the greater the bot's chances to walk instead of run.
58 bot.Client.Self.Jump(false); 57 Bot.Client.Self.Jump(false);
59 if (walkorrun == 0) 58 if (walkorrun == 0)
60 { 59 {
61 bot.Client.Self.Movement.AlwaysRun = true; 60 Bot.Client.Self.Movement.AlwaysRun = true;
62 } 61 }
63 else 62 else
64 { 63 {
65 bot.Client.Self.Movement.AlwaysRun = false; 64 Bot.Client.Self.Movement.AlwaysRun = false;
66 } 65 }
67 66
68 // TODO: unused: Vector3 pos = client.Self.SimPosition; 67 // TODO: unused: Vector3 pos = client.Self.SimPosition;
69 Vector3 newpos = new Vector3(bot.Random.Next(1, 254), bot.Random.Next(1, 254), bot.Random.Next(1, 254)); 68 Vector3 newpos = new Vector3(Bot.Random.Next(1, 254), Bot.Random.Next(1, 254), Bot.Random.Next(1, 254));
70 bot.Client.Self.Movement.TurnToward(newpos); 69 Bot.Client.Self.Movement.TurnToward(newpos);
71 70
72 bot.Client.Self.Movement.AtPos = true; 71 Bot.Client.Self.Movement.AtPos = true;
73 Thread.Sleep(bot.Random.Next(3000, 13000)); 72 Thread.Sleep(Bot.Random.Next(3000, 13000));
74 bot.Client.Self.Movement.AtPos = false; 73 Bot.Client.Self.Movement.AtPos = false;
75 bot.Client.Self.Jump(true); 74 Bot.Client.Self.Jump(true);
76 string randomf = talkarray[bot.Random.Next(talkarray.Length)]; 75 string randomf = talkarray[Bot.Random.Next(talkarray.Length)];
77 if (talkarray.Length > 1 && randomf.Length > 1) 76 if (talkarray.Length > 1 && randomf.Length > 1)
78 bot.Client.Self.Chat(randomf, 0, ChatType.Normal); 77 Bot.Client.Self.Chat(randomf, 0, ChatType.Normal);
79 } 78 }
80 79
81 private string[] readexcuses() 80 private string[] readexcuses()