public TimedEvent(string method, int time, PyScript script) { this.Method = method; this.Time = time; this.Script = script; this.DelayerTimer = new Timer(time); this.DelayerTimer.Enabled = true; this.DelayerTimer.Elapsed += new ElapsedEventHandler(DelayerTimer_Elapsed); this.DelayerTimer.Start(); }
public static void Load() { PyScriptPlatform.LoadWorldMemory(); Scripts.Clear(); foreach (var f in Directory.GetFiles("Scripts")) { var fInfos = new FileInfo(f); if (fInfos.Extension.ToLower() == ".py") { try { var script = new PyScript(f); script.Load(); Scripts.Add(script); } catch (Exception e) { Utilities.ConsoleStyle.Error("Can't load script engine for '" + f + "' : " + e.ToString()); } } } foreach (var f in Directory.GetFiles("Scripts/System")) { var fInfos = new FileInfo(f); if (fInfos.Extension.ToLower() == ".py") { try { var script = new PyScript(f); script.Load(); Scripts.Add(script); } catch (Exception e) { Utilities.ConsoleStyle.Error("Can't load script engine for '" + f + "' : " + e.ToString()); } } } }
public Fighter(int id, Database.Records.MonsterLevelRecord monster, Engines.Map.MonsterGroup group) { this.Drops = new FightDrops(this); this.MonsterGroup = group; this.Monster = monster; this._id = id; this._currentLife = this.Monster.Life; this.IsHuman = false; this.IsReady = true; this.IsDead = false; switch (Monster.GetTemplate.AI) { case 0: this.ArtificialBrain = new AI.StaticAI(this); break; case 1: case 2: this.ArtificialBrain = new AI.BasicAI(this); break; case 3: this.ArtificialBrain = new AI.FearfulAI(this); break; case 4: this.ArtificialBrain = new AI.ScriptedAI(this); if (this.Monster.GetTemplate.HasScriptAI()) { var scriptID = this.Monster.GetTemplate.Script; var script = new PyScript("Scripts/AI/" + scriptID); script.Load(this); (this.ArtificialBrain as AI.ScriptedAI).Script = script; } break; } this.CurrentAP = Stats.GetMaxActionPoints; this.CurrentMP = Stats.GetMaxMovementPoints; }
public PyScriptPlatform(PyScript script) { this.Script = script; }