public LockObstacle(ObjectField objectField, ObjectStage objectStage, ItemDropManager itemDropManager, FSM parentFsm) : base(objectField, objectStage, itemDropManager, parentFsm) { objectLockObstacle = TableLoader.GetTable<ObjectLockObstacle>().Get(objectStage.ObjectID); int lockCount = objectLockObstacle.LockCount; this.name = StringTableLoader.Instance.Get(objectField.ObjectName); InitStatus<LockStatus>( new object[] { LockStatus.Lock, 0, lockCount, lockCount } ); RegisterDeathCondition( delegate(Status current) { return current.Get(LockStatus.Lock) == 0; } ); AddAction(Action.E_Type.Unlock, delegate(float value, GameInstance firer, string[] param) { FSMEvent("damage"); return new ActionHandler.Result(LockStatus.Lock, -value); } ); AddAction(Action.E_Type.Attack, delegate(float value, GameInstance firer, string[] param) { FSMEvent("damage"); return new ActionHandler.Result(LockStatus.Lock, -1); } ); }
private IEnumerable <dynamic> GetNonInvasiveReportItemFromStages(ObjectStage obj) { var result = new List <dynamic>(); var stages = obj.GetAllStages() .Where(i => typeof(NavigateStage) .IsAssignableFrom(i.GetType())).Cast <NavigateStage>().ToList(); foreach (var stage in stages) { var invasive = stage.Actions.SelectMany(i => i.Arguments) .Where(a => !string.IsNullOrWhiteSpace(a.Name) && a.Name.ToLowerInvariant().Equals("noninvasive")).ToList(); foreach (var inv in invasive) { result.Add(new { Id = obj.Id, ObjectName = obj.Name, PageId = stage.PageId, PageName = string.IsNullOrWhiteSpace(stage.PageName) ? "Main" : stage.PageName, StageId = stage.Id, StageName = stage.Name, StageType = stage.Type, AttributeName = inv.Name, AttributeValue = inv.Value }); } } return(result); }
private void LoadAppModel(TreeNode parent, ObjectStage obj) { var root = new TreeNode("App Definition"); parent.Nodes.Add(root); if (obj.ApplicationDefinition == null) { return; } var app = new TreeNode(string.Format("{0} - {1}", obj.ApplicationDefinition.Name, obj.ApplicationDefinition.Type)) { Tag = obj.ApplicationDefinition.ApplicationTypeInfo }; root.Nodes.Add(app); foreach (var el in obj.ApplicationDefinition.Elements) { var elNode = new TreeNode(string.Format("{0} - {1}", el.Name, el.Type)) { Tag = el }; app.Nodes.Add(elNode); elNode.Tag = el; var attNode = new TreeNode("Attributes"); elNode.Nodes.Add(attNode); foreach (var att in el.Attributes.OrderByDescending(i => i.InUse)) { var aNode = new TreeNode(string.Format("{0} InUse: {1}", att.Name, att.InUse)) { Tag = att }; attNode.Nodes.Add(aNode); } } }
/// <summary> /// Provide the stages where an element is in use /// </summary> /// <param name="el">The element to search</param> /// <param name="obj">The object to use in the search</param> /// <returns></returns> public IEnumerable <Stage> ElementUses(ApplicationElement el, ObjectStage obj) { var res = new List <Stage>(); res.AddRange(ElementUses(el, obj.MainPage)); res.AddRange(ElementUses(el, obj.Pages.SelectMany(i => i.Stages))); return(res); }
public StageObject(ObjectField objectField, ObjectStage objectStage, ItemDropManager itemDropManager, FSM parentFsm) : base(objectStage.OverlapEvent, objectField, true) { Assert.IsTrue(objectStage != null); this.objectStage = objectStage; this.itemDropManager = itemDropManager; this.parentFsm = parentFsm; label = string.Format("{0}\n{1}", objectStage.Type.ToString(), objectStage.ObjectID); }
private ObjectStage CreateStage(XElement xml, IEnumerable <Stage> mainStages, IEnumerable <PageStage> pages) { var obj = new ObjectStage(xml) { MainPage = mainStages.ToList(), Pages = new List <PageStage>(pages), ApplicationDefinition = GetDefinition(xml) }; return(obj); }
private void AddResult(List <Result> res, string page, ObjectStage obj) { res.Add(new Result() { RuleName = Name, RuleDescription = GetRuleDescription(), Page = page, Type = ResultType.Error, Parent = obj.Name, Scope = "Object", Message = string.Format("There are many decisions in action {0} the max allowed is {1}", page, _maxCount) }); }
private Result GetFromObject(ObjectStage obj, string message) { return(new Result() { RuleName = GetRuleName(), RuleDescription = GetRuleDescription(), Parent = obj.Name, Type = ResultType.Error, Scope = "Object", Page = null, StageId = null, Stage = null, StageType = null, Message = message }); }
public MoneyObstacle(ObjectField objectField, ObjectStage objectStage, ItemDropManager itemDropManager, FSM parentFsm) : base(objectField, objectStage, itemDropManager, parentFsm) { InitStatus<Mob>( new object[] { Mob.Gold, 0, 100000, 0 } ); RegisterDeathCondition( delegate(Status current) { return current.Get(Mob.Gold) > 0; } ); AddAction(Action.E_Type.Money, delegate(float value, GameInstance firer, string[] param) { return new ActionHandler.Result(Mob.Gold, value); } ); }
protected virtual void OnDestroy() { m_ObjectStage = ObjectStage.Destroy; }
public RequiredForAttribute(ObjectStage stages) { Stages = stages; }
protected virtual void OnEnable() { m_ObjectStage = ObjectStage.Show; }
protected virtual void OnDisable() { m_ObjectStage = ObjectStage.Disable; }
protected virtual void Awake() { m_ObjectStage = ObjectStage.None; }
private dynamic GetNonIvasiveReportItem(ObjectStage obj) { var item = GetNonInvasiveReportItemFromAppStage(obj); return(item); }
private dynamic GetNonInvasiveReportItemFromAppStage(ObjectStage obj) { if (obj.ApplicationDefinition == null) { return(new { ObjectName = obj.Name, AppDefinitionType = string.Empty, AppTypeInfoId = string.Empty, IsNonInvasive = string.Empty, Description = obj.Description, Id = obj.Id }); } ; if (obj.ApplicationDefinition.ApplicationTypeInfo == null) { return(new { ObjectName = obj.Name, AppDefinitionType = string.Empty, AppTypeInfoId = string.Empty, IsNonInvasive = string.Empty, Description = obj.Description, Id = obj.Id }); } if (!obj.ApplicationDefinition.ApplicationTypeInfo.Parameters.Any()) { return(new { ObjectName = obj.Name, AppDefinitionType = obj.ApplicationDefinition.Type, AppTypeInfoId = obj.ApplicationDefinition.ApplicationTypeInfo.Id, IsNonInvasive = string.Empty, Description = obj.Description, Id = obj.Id }); } if (!obj.ApplicationDefinition.ApplicationTypeInfo.Parameters.Any(i => !string.IsNullOrWhiteSpace(i.Parameter) && i.Parameter == "NonInvasive" && !string.IsNullOrWhiteSpace(i.Value))) { return(new { ObjectName = obj.Name, AppDefinitionType = obj.ApplicationDefinition.Type, AppTypeInfoId = obj.ApplicationDefinition.ApplicationTypeInfo.Id, IsNonInvasive = string.Empty, Description = obj.Description, Id = obj.Id }); } else { return(new { ObjectName = obj.Name, AppDefinitionType = obj.ApplicationDefinition.Type, AppTypeInfoId = obj.ApplicationDefinition.ApplicationTypeInfo.Id, IsNonInvasive = obj.ApplicationDefinition .ApplicationTypeInfo .Parameters.First(i => i.Parameter.ToLowerInvariant().Equals("noninvasive")).Value.ToLowerInvariant().Equals("true"), Description = obj.Description, Id = obj.Id }); } }
public RestrictedAttribute(ObjectStage stages) { AllowedStages = stages; }
public StageEndDoor(ObjectField objectField, ObjectStage objectStage, ItemDropManager itemDropManager, FSM parentFsm) : base(objectField, objectStage, itemDropManager, parentFsm) { }
public BattleObstacle(ObjectField objectField, ObjectStage objectStage, ItemDropManager itemDropManager, FSM parentFsm) : base(objectField, objectStage, itemDropManager, parentFsm) { var statTable = StatLoader.Instance.GetStatTable<int, ObjectMonsterStat>("ObjectID"); Stat = statTable.Get(objectStage.ObjectID); objectMonster = TableLoader.GetTable<ObjectMonster>().Get(objectStage.ObjectID); name = StringTableLoader.Instance.Get(objectField.ObjectName); InitStatus<Mob>( new object[] { Mob.HP, 0, ObjectMonsterStat.MaximumLife, ObjectMonsterStat.MaximumLife, } ); RegisterDeathCondition( delegate(Status current) { return current.Get(Mob.HP) == 0; } ); AddAction(Action.E_Type.Attack, delegate(float value, GameInstance firer, string[] param) { bool isCritical = false; if (param != null) { foreach (var entity in param) { if (entity == "critical") { isCritical = true; } else if (entity == "charged") { FSMEvent("chargedAttack"); } } } string meterRes = "FieldEffect/TextPhysicalDmg"; if (isCritical) { meterRes = "FieldEffect/TextPhysicCriticalDmg"; PlaySound(79); } float damage = OnHit(value, ObjectMonsterStat.damageReduction, meterRes); return new ActionHandler.Result(Mob.HP, -damage); } ); AddAction(Action.E_Type.Suicide, delegate(float value, GameInstance firer, string[] param) { RemoveOverlapEvent(); RemoveHUD(); FSMEvent("Suicide"); return new ActionHandler.Result(Mob.HP, 0); } ); /* AddAction(Action.E_Type.Attack, delegate(float value, GameInstance firer, string[] param) { bool isCritical = false; if (param != null) { foreach (var entity in param) { if (entity == "critical") { isCritical = true; } } } string meterRes = "FieldEffect/TextMagicalDmg"; if (isCritical) { meterRes = "FieldEffect/TextMagicCriticalDmg"; PlaySound(79); } float damage = OnHit(value, ObjectMonsterStat.MagicResistance, meterRes); return new ActionHandler.Result(Mob.HP, -damage); } ); AddAction(Action.E_Type.NoneDefensiveAttack, delegate(float value, GameInstance firer, string[] param) { FSMEvent("damage"); CameraEffect.Instance.Flick(new Vector2(1, 1)); float damage = value; AttachMeter("FieldEffect/TextMagicalDmg", (int)damage); return new ActionHandler.Result(Mob.HP, -damage); } ); * */ AddAction(Action.E_Type.Buff, delegate(float value, GameInstance firer, string[] param) { Buff.Handle onBuff = null; Buff.Handle onDebuff = null; int? buffID = Cast.To<int>(value); Status.AddBuff(buffID.Value, firer.Stat, onBuff, onDebuff); return new ActionHandler.Result(null, value); } ); AddAction(Action.E_Type.Dispel, delegate(float value, GameInstance firer, string[] param) { Status.Dispel(); return new ActionHandler.Result(null, value); } ); if (!string.IsNullOrEmpty(objectMonster.fsm)) { InitFSM(objectMonster.fsm, this, false); } }
public SpotBuffer(ObjectField objectField, ObjectStage objectStage, ItemDropManager itemDropManager, FSM parentFsm) : base(objectField, objectStage, itemDropManager, parentFsm, GetRandomBuffer()) { InitFSM("Shrine.fsm", this, false); }
public BossMonster(ObjectField objectField, ObjectStage objectStage, ItemDropManager itemDropManager, FSM parentFsm) : base(objectField, objectStage, itemDropManager, parentFsm) { }
public Spot(ObjectField objectField, ObjectStage objectStage, ItemDropManager itemDropManager, FSM parentFsm, string actionPattern) : base(objectField, objectStage, itemDropManager, parentFsm) { this.actionPattern = actionPattern; name = objectStage.Type.ToString(); }