private void Awake() { warriorClass = gameObject.GetComponent <Warrior>(); conditionManager = gameObject.AddComponent <ConditionManager>(); meleeAbilityLogic = gameObject.AddComponent <MeleeAbilityLogic>(); movementAbilityLogic = gameObject.AddComponent <SpecialMovementAbilityLogic>(); }
protected override void Created(Actor self) { manager = self.TraitOrDefault<ConditionManager>(); watchers = self.TraitsImplementing<IConditionTimerWatcher>().Where(Notifies).ToArray(); base.Created(self); }
public static void GotoIfNot(string cardID, string conditionName) { if (!ConditionManager.Check(conditionName)) { Table.Instance.cardDispatcher.Dispatch(cardID); } }
public Oilpatch(ActorInitializer init, OilpatchInfo info) { this.info = info; resources = info.Amount == 0 ? init.World.WorldActor.Trait <OilAmount>().Amount : info.Amount; burnTotal = this.info.FullAmount * init.World.WorldActor.Trait <OilpatchBurn>().Amount / 100; conditionManager = init.Self.TraitOrDefault <ConditionManager>(); }
void INotifyCreated.Created(Actor self) { conditionManager = self.TraitOrDefault <ConditionManager>(); if (!skipMakeAnimation) { Forward(self, () => { }); } }
protected override void Created(Actor self) { ammoPool = self.TraitsImplementing <AmmoPool>().FirstOrDefault(la => la.Info.Name == Info.AmmoPoolName); maxAmmo = ammoPool.Info.Ammo; conditionManager = self.TraitOrDefault <ConditionManager>(); base.Created(self); }
public ExternalCaptureActor(Actor self, Target target) { this.target = target; capturable = target.Actor.Trait <ExternalCapturable>(); capturesInfo = self.Info.TraitInfo <ExternalCapturesInfo>(); mobile = self.Trait <Mobile>(); conditionManager = self.TraitOrDefault <ConditionManager>(); }
void INotifyCreated.Created(Actor self) { conditionManager = self.TraitOrDefault <ConditionManager>(); UpdateCondition(self); // HACK: Temporarily needed until Rearm activity is gone for good RemainingTicks = Info.ReloadDelay; }
public AttackMoveActivity(Actor self, Func <Activity> getInner, bool assaultMoving = false) { this.getInner = getInner; autoTarget = self.TraitOrDefault <AutoTarget>(); conditionManager = self.TraitOrDefault <ConditionManager>(); attackMove = self.TraitOrDefault <AttackMove>(); isAssaultMove = assaultMoving; }
void INotifyCreated.Created(Actor self) { manager = self.Trait <ConditionManager>(); if (self.Owner.PlayerName == "Neutral") { GrantCondition(self, info.Condition); } }
void Start() { Physics2D.queriesHitTriggers = true; rb = GetComponent <Rigidbody2D> (); coll = GetComponent <Collider2D> (); main = GetComponent <ShipComponent> (); lightning = GameObject.Find("LineManager").GetComponent <Lightning> (); contactCondition = new ConditionManager(); }
void Awake() { if (instance != null) { Debug.LogError("More than one conditionmanager!!!!!!"); return; } instance = this; }
protected virtual void Created(Actor self) { repairable = self.TraitOrDefault <Repairable>(); rearmable = self.TraitOrDefault <Rearmable>(); conditionManager = self.TraitOrDefault <ConditionManager>(); speedModifiers = self.TraitsImplementing <ISpeedModifier>().ToArray().Select(sm => sm.GetSpeedModifier()); cachedPosition = self.CenterPosition; notifyMoving = self.TraitsImplementing <INotifyMoving>().ToArray(); }
void INotifyCreated.Created(Actor self) { manager = self.Trait <ConditionManager>(); if (!IsTraitDisabled) { SetDefaultState(); } }
public ActionResult Upload() { DepartmentManager departmentManager = new DepartmentManager(); ConditionManager conditionManager = new ConditionManager(); ViewBag.Conditions = conditionManager.GetConditions(); ViewBag.Departments = departmentManager.GetAllDepartments(); return(View()); }
public HordeBonus(Actor self, HordeBonusInfo info) { this.info = info; this.self = self; manager = self.Trait <ConditionManager>(); cachedRange = info.Range; cachedVRange = info.MaximumVerticalOffset; sources = new HashSet <Actor>(); }
public override void OnInspectorGUI() { DrawDefaultInspector(); ConditionManager myScript = (ConditionManager)target; if (GUILayout.Button("SaveCarPosition")) { myScript.SaveCarPose(); } }
void INotifyCreated.Created(Actor self) { conditionManager = self.TraitOrDefault <ConditionManager>(); var building = self.TraitOrDefault <Building>(); if (building != null && !building.SkipMakeAnimation) { Forward(self, () => building.NotifyBuildingComplete(self)); } }
public SmarthomeAdapter(BridgeConfiguration configuration, ConditionManager conditionMgr) : base(configuration) { _conditionManager = conditionMgr; _abo = new AdapterBusObject("Guybrush"); AdapterInterface conditionInterface = new AdapterInterface("com.guybrush.station.conditions"); var addConInputParams = new List <AdapterValue>(); addConInputParams.Add(new AdapterValue("SourceDeviceType", -1)); addConInputParams.Add(new AdapterValue("SourceDevice", "")); addConInputParams.Add(new AdapterValue("TargetDevice", "")); addConInputParams.Add(new AdapterValue("RequiredValue", -1)); addConInputParams.Add(new AdapterValue("ConditionType", -1)); addConInputParams.Add(new AdapterValue("TargetValue", -1)); var addConOutParams = new List <AdapterValue>(); addConOutParams.Add(new AdapterValue("Response", "")); AdapterMethod addCondAttr = new AdapterMethod("AddCondition", "Calling this method will add new condition.", AddCondition, addConInputParams, addConOutParams); conditionInterface.Methods.Add(addCondAttr); var getCondOutParams = new List <AdapterValue>(); getCondOutParams.Add(new AdapterValue("SourceDeviceType", "")); getCondOutParams.Add(new AdapterValue("SourceDevice", "")); getCondOutParams.Add(new AdapterValue("TargetDevice", "")); getCondOutParams.Add(new AdapterValue("RequiredValue", "")); getCondOutParams.Add(new AdapterValue("ConditionType", "")); getCondOutParams.Add(new AdapterValue("TargetValue", "")); AdapterMethod getCondAttr = new AdapterMethod("GetConditions", "Calling this method returns list of conditions", GetConditions, null, getCondOutParams); conditionInterface.Methods.Add(getCondAttr); var removeCondInputParams = new List <AdapterValue>(); removeCondInputParams.Add(new AdapterValue("SourceDevice", "")); removeCondInputParams.Add(new AdapterValue("TargetDevice", "")); var removeConOutParams = new List <AdapterValue>(); removeConOutParams.Add(new AdapterValue("Response", "")); AdapterMethod removeCondAttr = new AdapterMethod("RemoveCondition", "Calling this method will remove a condition", RemoveCondition, removeCondInputParams, removeConOutParams); conditionInterface.Methods.Add(removeCondAttr); _abo.Interfaces.Add(conditionInterface); BusObjects.Add(_abo); }
public bool CanUseEssences() { PlayerConditionRecord condition = CliDB.PlayerConditionStorage.LookupByKey(PlayerConst.PlayerConditionIdUnlockedAzeriteEssences); if (condition != null) { return(ConditionManager.IsPlayerMeetingCondition(GetOwner(), condition)); } return(false); }
protected override void Created(Actor self) { manager = self.Trait <ConditionManager>(); if (!IsTraitDisabled) { SetDefaultState(); } base.Created(self); }
private void Init() { csvData = GetComponent <CsvDataManager>(); csvData.Init(); variable = GetComponent <GlobalVariableManager>(); variable.Init(); condition = GetComponent <ConditionManager>(); condition.Init(); }
void Awake() { if (Instance == null) { Instance = this; } else { Destroy(this); } }
public SwallowActor(Actor self, Target target, Armament a, IFacing facing) { this.target = target; this.facing = facing; armament = a; weapon = a.Weapon; sandworm = self.Trait <Sandworm>(); positionable = self.Trait <Mobile>(); swallow = self.Trait <AttackSwallow>(); conditionManager = self.TraitOrDefault <ConditionManager>(); }
public override void OnInspectorGUI() { if (gvm == null || dictDrawer == null) { gvm = target as ConditionManager; dictDrawer = new DictionaryEditorDrawer <string, CardCondition>(this, "Conditions", gvm.Data, DrawVar); } DrawDefaultInspector(); dictDrawer.OnInspectorGUI(); }
protected override void Created(Actor self) { base.Created(self); conditionManager = self.Trait <ConditionManager>(); if (!string.IsNullOrEmpty(Info.LoadedCondition) && loadedConditionToken == ConditionManager.InvalidConditionToken) { loadedConditionToken = conditionManager.GrantCondition(self, Info.LoadedCondition); } }
void INotifyCreated.Created(Actor self) { conditionManager = self.TraitOrDefault <ConditionManager>(); if (self.Info.HasTraitInfo <CargoInfo>()) { CargoNow = self.TraitsImplementing <Cargo>().FirstOrDefault().PassengerCount; CargoBefore = self.TraitsImplementing <Cargo>().FirstOrDefault().PassengerCount; } Timer = info.ResetTime; ChargeTime = info.ResetTime; cannotdsguise = true; }
public int GetCompleteNodeRoute(TaxiNodesRecord from, TaxiNodesRecord to, Player player, List <uint> shortestPath) { /* * Information about node algorithm from client * Since client does not give information about *ALL* nodes you have to pass by when going from sourceNodeID to destinationNodeID, we need to use Dijkstra algorithm. * Examining several paths I discovered the following algorithm: * If destinationNodeID has is the next destination, connected directly to sourceNodeID, then, client just pick up this route regardless of distance * else we use dijkstra to find the shortest path. * When early landing is requested, according to behavior on retail, you can never end in a node you did not discovered before */ // Find if we have a direct path uint pathId, goldCost; Global.ObjectMgr.GetTaxiPath(from.Id, to.Id, out pathId, out goldCost); if (pathId != 0) { shortestPath.Add(from.Id); shortestPath.Add(to.Id); } else { shortestPath.Clear(); // We want to use Dijkstra on this graph DijkstraShortestPath g = new DijkstraShortestPath(m_graph, (int)GetVertexIDFromNodeID(from)); var path = g.PathTo((int)GetVertexIDFromNodeID(to)); // found a path to the goal shortestPath.Add(from.Id); foreach (var edge in path) { //todo test me No clue about this.... var To = m_nodesByVertex[(int)edge.To]; TaxiNodeFlags requireFlag = (player.GetTeam() == Team.Alliance) ? TaxiNodeFlags.Alliance : TaxiNodeFlags.Horde; if (!To.Flags.HasAnyFlag(requireFlag)) { continue; } PlayerConditionRecord condition = CliDB.PlayerConditionStorage.LookupByKey(To.ConditionID); if (condition != null) { if (!ConditionManager.IsPlayerMeetingCondition(player, condition)) { continue; } } shortestPath.Add(GetNodeIDFromVertexID(edge.To)); } } return(shortestPath.Count); }
protected override void Created(Actor self) { base.Created(self); conditionManager = self.Trait <ConditionManager>(); var burst = Info.InitialActorCount == -1 ? Info.Actors.Length : Info.InitialActorCount; for (var i = 0; i < burst; i++) { Replenish(self, ChildEntries); } }
protected override void Created(Actor self) { conditionManager = self.Trait <ConditionManager>(); if (Info.RandomConditions.Count == 0) { PickedCondition = Info.FallbackCondition; } else { PickedCondition = Info.RandomConditions.ElementAt(self.World.SharedRandom.Next(Info.RandomConditions.Count)); } base.Created(self); }