예제 #1
0
        public int CallTakingDamages(World.Game.Fights.Fighter fighter, int damages)
        {
            try
            {
                var returnedDamages = damages;

                this.Scope.SetVariable("monster", fighter);
                this.Scope.SetVariable("damages", damages);

                returnedDamages = this.DoMethodReturn("onTakingDamages(monster, damages)");

                this.Scope.RemoveVariable("monster");
                this.Scope.RemoveVariable("damages");

                return(returnedDamages);
            }
            catch (Exception e)
            {
                if (this.Platform.showErrors)
                {
                    Utilities.ConsoleStyle.Error("Can't call script : " + e.ToString());
                }
                return(damages);
            }
        }
예제 #2
0
        public void CallPerformAI(World.Game.Fights.Fighter fighter)
        {
            try
            {
                if (!this.IsPlugin)
                {
                    this.Scope.SetVariable("monster", fighter);

                    this.DoMethod("onPerformAI(monster)");

                    this.Scope.RemoveVariable("monster");
                }
            }
            catch (Exception e)
            {
                if (this.Platform.showErrors)
                {
                    Utilities.ConsoleStyle.Error("Can't call script : " + e.ToString());
                }
            }
        }