/// <summary> /// 태그를 기준을 대상 오브젝트들을 활성화/비활성화 처리합니다. /// </summary> /// <param name="tags"></param> /// <param name="show"></param> private void Show(string[] tags, bool show) { if (tags == null || tags.Length == 0) { return; } var enums = EnumUtil <TargetTag> .Instance; for (int i = 0; i < tags.Length; i++) { TargetTag tag = TargetTag.Invalid; if (!enums.TryParse(tags[i], out tag)) { continue; } var targets = targetObjects.FindTargets(tag); if (targets == null || targets.Count == 0) { continue; } for (int t = 0; t < targets.Count; t++) { var go = targets[t]; if (go != null) { go.SetActive(show); } } } }
public static List <Units> GetAllians(Units target, float distance, TargetTag tag, bool isAllians = true) { TeamType teamType = TeamType.None; if (isAllians) { teamType = (TeamType)target.teamType; } else if (target.teamType == 0) { teamType = TeamType.BL; } else if (target.teamType == 1) { teamType = TeamType.LM; } List <Units> list = new List <Units>(); IList <Units> mapUnits = MapManager.Instance.GetMapUnits(teamType, tag); if (mapUnits == null) { return(list); } foreach (Units current in mapUnits) { if (!(current == null)) { if (UnitFeature.DistanceToPoint(target.transform.position, current.transform.position) <= distance) { list.Add(current); } } } return(list); }
public AttackDescription(int manaCost, int energyCost, int attackModifier, TargetTag targetTag) { this.manaCost = manaCost; this.energyCost = energyCost; this.attackModifier = attackModifier; this.targetTag = targetTag; }
public List <Units> GetListOfRecentlySensedOpponents(Relation relation, TargetTag tagType = TargetTag.All, bool isVisibile = true, bool isCheckTaunted = false, SortType sortType = SortType.None, FindType findType = FindType.None, object param = null) { this.target_units.Clear(); bool flag = false; for (int i = 0; i < this.m_MemoryId.Count; i++) { int num = this.m_MemoryId[i]; MemoryRecord memoryRecord = this.m_MemoryMap[num]; if (memoryRecord != null) { if (!isVisibile || memoryRecord.bWithingFOV) { Units unit = MapManager.Instance.GetUnit(num); if (unit == null || !unit.isLive) { this.m_MemoryMap[num] = null; } else if (relation == Relation.Hostility) { if (TeamManager.CanAttack(this.m_Owner, unit)) { if (isCheckTaunted && unit.ChaoFeng.IsInState) { this.target_units.Clear(); this.target_units.Add(unit); flag = true; break; } if (TagManager.CheckTag(unit, tagType)) { this.target_units.Add(unit); } } } else if (relation == Relation.Companion && TeamManager.CanAssist(this.m_Owner, unit)) { if (TagManager.CheckTag(unit, tagType)) { this.target_units.Add(unit); } } } } } if (!flag) { if (sortType != SortType.None) { FindTargetHelper.SortTargets(this.m_Owner, sortType, ref this.target_units); } if (findType != FindType.None) { FindTargetHelper.FilterTargetsRef(this.m_Owner, ref this.target_units, findType, param); } } return(this.target_units); }
public void setTargetStatus(TargetTag myTag, bool status) { switch (myTag) { case TargetTag.Camp: campStatus = status; break; case TargetTag.Fire: FireStatus = status; break; } }
private static bool CheckTagType(string tag, TargetTag tagType) { switch (tagType) { case TargetTag.All: return(true); case TargetTag.Hero: return(tag.Equals("Hero") || tag.Equals("Player")); case TargetTag.Monster: return(tag.Equals("Monster")); case TargetTag.Tower: return(tag.Equals("Building")); case TargetTag.Home: return(tag.Equals("Home")); case TargetTag.BuffItem: return(tag.Equals("BuffItem")); case TargetTag.Item: return(tag.Equals("Item")); case TargetTag.HeroAndMonster: return(tag.Equals("Hero") || tag.Equals("Player") || tag.Equals("Monster")); case TargetTag.Building: return(tag.Equals("Home") || tag.Equals("Building")); case TargetTag.Player: return(tag.Equals("Player")); case TargetTag.Creeps: return(tag.Equals("Monster")); case TargetTag.Minions: return(tag.Equals("Monster")); case TargetTag.CreepsAndMinions: return(tag.Equals("Monster")); default: return(false); } }
/// <summary> /// For find oppose Walker /// </summary> protected void UpdateOpposeWalkerInRange() { //Find all GameObject with this tag GameObject[] opposeWalkers = GameObject.FindGameObjectsWithTag(TargetTag.ToString()); //initialisation shortestDistance to inifinit value float shortestDistance = float.PositiveInfinity; GameObject nerestOpposeWalker = null; foreach (GameObject item in opposeWalkers) { //Get distance between 2 vector3 float DistanceToOppeseWalker = Vector3.Distance(transform.position, item.transform.position); if (DistanceToOppeseWalker < shortestDistance) { shortestDistance = DistanceToOppeseWalker; nerestOpposeWalker = item; } } // If one gameobject find and if is in range if (nerestOpposeWalker != null && shortestDistance <= this.range) { this.OpposeWalkerTarget = nerestOpposeWalker; if (this.FireCountdown <= 0f) { this.Shoot(); this.FireCountdown = 1 / fireRate; } this.IsWalking = false; } else { this.IsWalking = true; } }
public void Execute(IRuleExecutionContext context) { var commerceContext = context.Fact <CommerceContext>(); var cart = commerceContext?.GetObject <Cart>(); var totals = commerceContext?.GetObject <CartTotals>(); if (cart == null || !cart.Lines.Any() || totals == null || !totals.Lines.Any()) { return; } Commander.Command <ApplyFreeGiftEligibilityCommand>().Process(commerceContext, cart, GetType().Name); var matchingLines = TargetTag.YieldCartLinesWithTag(context); foreach (var matchingLine in matchingLines) { Commander.Command <ApplyFreeGiftDiscountCommand>().Process(commerceContext, matchingLine, GetType().Name); Commander.Command <ApplyFreeGiftAutoRemoveCommand>().Process(commerceContext, matchingLine, AutoRemove.Yield(context)); } }
public override string ToDebugString() { return($"{ToolBox.GetDebugSymbol(HasBeenDetermined())} {nameof(CheckItemAction)} -> (TargetTag: {TargetTag.ColorizeObject()}, " + $"ItemIdentifiers: {ItemIdentifiers.ColorizeObject()}" + $"Succeeded: {succeeded.ColorizeObject()})"); }
public static bool CheckTag(Units target, TargetTag targetTag) { if (target != null) { int dataInt = target.data.GetDataInt(DataType.ItemType); switch (targetTag) { case TargetTag.Tower: if (dataInt == 2) { return(true); } return(false); case TargetTag.Creeps: if (dataInt == 3 || dataInt == 7 || dataInt == 9) { return(true); } return(false); case TargetTag.Minions: if (dataInt == 1) { return(true); } return(false); case TargetTag.CreepsAndMinions: if (dataInt == 1 || dataInt == 3 || dataInt == 7 || dataInt == 9) { return(true); } return(false); case TargetTag.TowerAndHome: if (dataInt == 2 || dataInt == 4) { return(true); } return(false); case TargetTag.EyeUnit: if (dataInt == 8) { return(true); } return(false); case TargetTag.Pet: if (dataInt == 10) { return(true); } return(false); case TargetTag.Labisi: if (dataInt == 11) { return(true); } return(false); } if (TagManager.CheckTagType(target.tag, targetTag)) { return(true); } } return(false); }
public override void OnSkill(ITriggerDoActionParam param) { TriggerParamSkillControl triggerParamSkillControl = param as TriggerParamSkillControl; if (!this.self.CanManualControl()) { return; } Skill skillOrAttackById = this.self.getSkillOrAttackById(triggerParamSkillControl.SkillID); Units selectedTarget = PlayerControlMgr.Instance.GetSelectedTarget(); Units units = null; TargetTag targetTag = skillOrAttackById.data.targetTag; if (!skillOrAttackById.NeedCustomTargetInCrazy()) { if (selectedTarget == null || skillOrAttackById.NeedAutoLaunchToHero()) { if (selectedTarget == null && skillOrAttackById.skillIndex == 4 && units == null && targetTag == TargetTag.HeroAndMonster) { units = this.self; } else { units = FindTargetHelper.FindAutoSkillTarget(this.self, this.self.trans.position, TargetTag.Hero, (this.self.atk_type != 1) ? (base.GetSkillRange(skillOrAttackById) + 3f) : 6.5f, skillOrAttackById.data.targetCamp, null); } } if (units == null) { units = selectedTarget; } if (!skillOrAttackById.data.needTarget && skillOrAttackById.data.isMoveSkill) { units = null; } else if (((units == null || units.isHero) && targetTag == TargetTag.CreepsAndMinions) || targetTag == TargetTag.Monster || targetTag == TargetTag.Minions || targetTag == TargetTag.Creeps) { units = FindTargetHelper.FindAutoSkillTarget(this.self, this.self.trans.position, targetTag, (this.self.atk_type != 1) ? (base.GetSkillRange(skillOrAttackById) + 3f) : 6.5f, SkillTargetCamp.None, null); } else if (units == null && targetTag == TargetTag.HeroAndMonster) { units = FindTargetHelper.FindAutoSkillTarget(this.self, this.self.trans.position, targetTag, (this.self.atk_type != 1) ? (base.GetSkillRange(skillOrAttackById) + 3f) : 6.5f, skillOrAttackById.data.targetCamp, skillOrAttackById); } } else { units = skillOrAttackById.CustomTargetInCrazy(); } if (skillOrAttackById.needTarget) { units = base.GetSkillTarget(skillOrAttackById, units, true); if (units != null && !units.CanBeSelected) { units = null; } units = skillOrAttackById.ReselectTarget(units, true); if (units != null) { this.DisableAIAutoAttackMove(); this.targetCom.ClearMoveFlag(); if (units != null) { this.self.mCmdCacheController.EnqueueSkillCmd(triggerParamSkillControl.SkillID, units.mTransform.position, units, true, true); } } else { Singleton <SkillView> .Instance.ShowSkillWarn("需要指定一个有效目标!"); Singleton <TriggerManager> .Instance.SendUnitSkillStateEvent(UnitEvent.UnitSkillCmdCrazyPointer, this.self, skillOrAttackById); } } else { if (units != null && !units.CanBeSelected) { units = null; } if (units == this.self) { units = null; } Vector3 vector = this.self.mTransform.forward; if (units != null) { vector = units.mTransform.position; if (Vector3.Distance(vector, this.self.mTransform.position) > skillOrAttackById.distance + 3f) { Vector3 a = vector - this.self.mTransform.position; a.Normalize(); vector = this.self.mTransform.position + a * skillOrAttackById.distance; } } else { vector.Normalize(); if (skillOrAttackById.distance == 0f) { vector = this.self.mTransform.position + vector; } else { vector = this.self.mTransform.position + vector * skillOrAttackById.distance; } } if (skillOrAttackById.NeedResetTargetPos()) { vector = skillOrAttackById.GetExtraTargetPos(units, vector, true); } this.DisableAIAutoAttackMove(); this.targetCom.ClearMoveFlag(); this.self.mCmdCacheController.EnqueueSkillCmd(triggerParamSkillControl.SkillID, vector, units, true, true); } }
public override void OnSkill(ITriggerDoActionParam param) { TriggerParamSkillControl triggerParamSkillControl = param as TriggerParamSkillControl; Skill skillOrAttackById = this.self.getSkillOrAttackById(triggerParamSkillControl.SkillID); Units selectedTarget = PlayerControlMgr.Instance.GetSelectedTarget(); Units units = null; TargetTag targetTag = skillOrAttackById.data.targetTag; if (selectedTarget == null || skillOrAttackById.NeedAutoLaunchToHero()) { if (selectedTarget == null && skillOrAttackById.skillIndex == 4 && units == null && targetTag == TargetTag.HeroAndMonster) { units = this.self; } else { units = FindTargetHelper.FindAutoSkillTarget(this.self, this.self.trans.position, TargetTag.Hero, (this.self.atk_type != 1) ? (base.GetSkillRange(skillOrAttackById) + 3f) : 6.5f, skillOrAttackById.data.targetCamp, null); } } if (units == null) { units = selectedTarget; } if (!skillOrAttackById.data.needTarget && skillOrAttackById.data.isMoveSkill) { units = null; } else if (((units == null || units.isHero) && targetTag == TargetTag.CreepsAndMinions) || targetTag == TargetTag.Monster || targetTag == TargetTag.Minions || targetTag == TargetTag.Creeps) { units = FindTargetHelper.FindAutoSkillTarget(this.self, this.self.trans.position, targetTag, (this.self.atk_type != 1) ? (base.GetSkillRange(skillOrAttackById) + 3f) : 6.5f, skillOrAttackById.data.targetCamp, null); } else if (units == null && targetTag == TargetTag.HeroAndMonster) { units = FindTargetHelper.FindAutoSkillTarget(this.self, this.self.trans.position, targetTag, (this.self.atk_type != 1) ? (base.GetSkillRange(skillOrAttackById) + 3f) : 6.5f, skillOrAttackById.data.targetCamp, skillOrAttackById); } this.targetCom.ClearMoveFlag(); if (!this.self.CanManualControl()) { return; } if (this.self.IsSkillCanTriggerBornPowerObj(triggerParamSkillControl.SkillID)) { this.ClearReadySkill(); this.LaunchSkill(skillOrAttackById, units, true); return; } if (!this.DoseSkillNeedDoubleClick(skillOrAttackById)) { this.ClearReadySkill(); this.LaunchSkill(skillOrAttackById, units, true); return; } if (skillOrAttackById == this.readySkill) { if (this.ReadySkillOld()) { this.readyTm = Time.realtimeSinceStartup; this.ClearReadySkill(); } else { this.ClearReadySkill(); this.LaunchSkill(skillOrAttackById, units, true); } return; } if (this.readySkill == null && this.lastReadySkill == skillOrAttackById && Time.realtimeSinceStartup - this.readyTm < 0.5f) { this.ClearReadySkill(); this.LaunchSkill(skillOrAttackById, units, true); return; } this.SetReadySkill(skillOrAttackById, units); }
private void Parse(SysSkillPerformVo perform_vo) { if (perform_vo.action_id != "[]") { string[] stringValue = StringUtils.GetStringValue(perform_vo.action_id, '_'); if (stringValue != null) { this.action_type = this.GetActionType(stringValue[0]); if (stringValue.Length > 1) { this.action_index = int.Parse(stringValue[1]); } } } if (perform_vo.effect_type != "[]") { string[] array = StringUtils.SplitVoString(perform_vo.effect_type, "|"); this.effect_type = (PerformType)int.Parse(array[0]); this.GetPerformParam(array); } this.body_dispear = (perform_vo.body_dispear == 1); this.body_dissolve = (perform_vo.body_dissolve == 1); this.body_destroy = (perform_vo.body_destroy == 1); if (StringUtils.CheckValid(perform_vo.use_collider)) { string[] array2 = StringUtils.SplitVoString(perform_vo.use_collider, "|"); this.useCollider = (int.Parse(array2[0]) == 1); this.colliderRangeType = (ColliderRangeType)((array2.Length <= 1) ? 0 : int.Parse(array2[1])); this.colliderParam1 = ((array2.Length <= 2) ? 0f : float.Parse(array2[2])); this.colliderParam2 = ((array2.Length <= 3) ? 0f : float.Parse(array2[3])); } if (perform_vo.effect_pos_offset != "[]") { this.effect_pos_offset = StringUtils.GetStringToFloat(perform_vo.effect_pos_offset, '|'); this.offset_x = ((this.effect_pos_offset == null) ? 0f : this.effect_pos_offset[0]); this.offset_y = ((this.effect_pos_offset == null || this.effect_pos_offset.Length <= 1) ? 0f : this.effect_pos_offset[1]); this.offset_z = ((this.effect_pos_offset == null || this.effect_pos_offset.Length <= 2) ? 0f : this.effect_pos_offset[2]); } if (perform_vo.effect_rotation_offset != "[]") { this.effect_rotation_offset = StringUtils.GetStringToFloat(perform_vo.effect_rotation_offset, '|'); this.offset_rx = ((this.effect_rotation_offset == null) ? 0f : this.effect_rotation_offset[0]); this.offset_ry = ((this.effect_rotation_offset == null || this.effect_rotation_offset.Length <= 1) ? 0f : this.effect_rotation_offset[1]); this.offset_rz = ((this.effect_rotation_offset == null || this.effect_rotation_offset.Length <= 2) ? 0f : this.effect_rotation_offset[2]); } this.endPerformId = "[]"; this.isBeInterruptThenDestroy = true; this.isDeadThenDestroy = true; this.isUseCasterRot = true; this.isUsePool = true; this.particleClose_time = 0f; this.isCloneDmage = false; this.isEndAction = true; this.isLoopSound = false; this.isDamageColliderFollow = true; this.isDamageColliderFollowUnit = false; this.performTagType = TargetTag.All; this.isAffectWeapon = false; this.weaponPosType = 0; this.isForceDisplay = false; if (StringUtils.CheckValid(perform_vo.extra_param)) { string[] stringValue2 = StringUtils.GetStringValue(perform_vo.extra_param, ','); for (int i = 0; i < stringValue2.Length; i++) { if (StringUtils.CheckValid(stringValue2[i])) { string[] array3 = StringUtils.SplitVoString(stringValue2[i], "|"); if (array3[0] == "1") { this.endPerformId = array3[1]; } else if (array3[0] == "2") { if (array3[1] == "1") { this.isBeInterruptThenDestroy = true; } else if (array3[1] == "0") { this.isBeInterruptThenDestroy = false; } } else if (array3[0] == "3") { if (array3[1] == "1") { this.isUseCasterRot = true; } else if (array3[1] == "0") { this.isUseCasterRot = false; } } else if (array3[0] == "4") { if (array3[1] == "1") { this.isDeadThenDestroy = true; } else if (array3[1] == "0") { this.isDeadThenDestroy = false; } } else if (array3[0] == "5") { if (array3[1] == "1") { this.isUsePool = true; } else if (array3[1] == "0") { this.isUsePool = false; } } else if (array3[0] == "6") { this.particleClose_time = float.Parse(array3[1]); } else if (!(array3[0] == "7")) { if (array3[0] == "8") { if (array3[1] == "1") { this.isCloneDmage = true; } else if (array3[1] == "0") { this.isCloneDmage = false; } } else if (array3[0] == "9") { if (array3[1] == "1") { this.isEndAction = true; } else if (array3[1] == "0") { this.isEndAction = false; } } else if (array3[0] == "10") { if (array3[1] == "1") { this.isLoopSound = true; } else if (array3[1] == "0") { this.isLoopSound = false; } } else if (array3[0] == "11") { if (array3[1] == "1") { this.isDamageColliderFollow = true; } else if (array3[1] == "0") { this.isDamageColliderFollow = false; } } else if (array3[0] == "12") { if (array3[1] == "1") { this.isDamageColliderFollowUnit = true; } else if (array3[1] == "0") { this.isDamageColliderFollowUnit = false; } } else if (array3[0] == "13") { this.performTagType = (TargetTag)int.Parse(array3[1]); } else if (array3[0] == "14") { this.isAffectWeapon = true; if (array3.Length > 1) { int num = 0; if (int.TryParse(array3[1], out num)) { this.weaponPosType = num; } } } else if (array3[0] == "15") { this.colliderAnchorType = ColliderAnchorType.centor; if (array3.Length > 1) { int num2 = 0; if (int.TryParse(array3[1], out num2) && num2 == 1) { this.colliderAnchorType = ColliderAnchorType.bottom; } } } else if (array3[0] == "16") { this.eyeRange = float.Parse(array3[1]); } else if (array3[0] == "22") { if (array3[1] == "0") { this.isForceDisplay = false; } else if (array3[1] == "1") { this.isForceDisplay = true; } } } } } } }
private IList <Units> GetAliveByType(TeamType teamType, TargetTag tag) { return(MapManager.Instance.GetMapUnits(teamType, tag)); }
private void Parse(SysSkillHigheffVo higheff_vo) { if (StringUtils.CheckValid(higheff_vo.target_type)) { int[] stringToInt = StringUtils.GetStringToInt(higheff_vo.target_type, '|'); this.targetCamp = (SkillTargetCamp)((stringToInt == null) ? 0 : stringToInt[0]); this.targetTag = (TargetTag)((stringToInt.Length <= 1) ? 0 : stringToInt[1]); } if (StringUtils.CheckValid(higheff_vo.effective_range)) { float[] stringToFloat = StringUtils.GetStringToFloat(higheff_vo.effective_range, '|'); this.rangeRadius = ((stringToFloat == null) ? 0f : stringToFloat[0]); this.maxNum = ((stringToFloat.Length <= 1) ? 2147483647 : ((int)stringToFloat[1])); this.higheffTrigerCount = ((stringToFloat.Length <= 2) ? 2147483647 : ((int)stringToFloat[2])); } if (StringUtils.CheckValid(higheff_vo.higheff_type)) { string[] stringValue = StringUtils.GetStringValue(higheff_vo.higheff_type, '|'); this.higheffType = (HighEffType)int.Parse(stringValue[0]); this.SetHighEffParam(this.higheffType, stringValue); } if (StringUtils.CheckValid(higheff_vo.cd_time)) { string[] stringValue2 = StringUtils.GetStringValue(higheff_vo.cd_time, ','); this.cdTime = ((stringValue2.Length <= 0) ? 0f : float.Parse(stringValue2[0])); this.delayTime = ((stringValue2.Length <= 1) ? 0f : float.Parse(stringValue2[1])); } if (StringUtils.CheckValid(higheff_vo.perform_id)) { this.performIds = StringUtils.GetStringValue(higheff_vo.perform_id, ','); } if (StringUtils.CheckValid(higheff_vo.attach_higheff)) { this.attachHighEffs = StringUtils.GetStringValue(higheff_vo.attach_higheff, ','); } if (StringUtils.CheckValid(higheff_vo.attach_buff)) { this.attachBuffs = StringUtils.GetStringValue(higheff_vo.attach_buff, ','); } if (StringUtils.CheckValid(higheff_vo.attach_self_higheff)) { this.attachSelfHighEffs = StringUtils.GetStringValue(higheff_vo.attach_self_higheff, ','); } this.isAutoDestroy = (higheff_vo.isAutoDestroy != 0); if (StringUtils.CheckValid(higheff_vo.damage_id)) { this.damage_ids = StringUtils.GetStringToInt(higheff_vo.damage_id, ','); } if (StringUtils.CheckValid(higheff_vo.effectGain)) { string[] stringValue3 = StringUtils.GetStringValue(higheff_vo.effectGain, '|'); if (stringValue3.Length > 0) { this.DataType.MagicType = (EffectMagicType)int.Parse(stringValue3[0]); } if (stringValue3.Length > 1) { this.DataType.GainType = (EffectGainType)int.Parse(stringValue3[1]); } if (stringValue3.Length > 2) { this.DataType.ImmuneType = (EffectImmuneType)int.Parse(stringValue3[2]); } } }
public override string ToDebugString() { return($"{ToolBox.GetDebugSymbol(isFinished)} {nameof(NPCFollowAction)} -> (NPCTag: {NPCTag.ColorizeObject()}, TargetTag: {TargetTag.ColorizeObject()}, Follow: {Follow.ColorizeObject()})"); }
public static bool CheckTarget(GameObject self, GameObject target, SkillTargetCamp targetCampType, TargetTag targetTag) { return(TagManager.CheckTag(target, targetTag) && TeamManager.CheckTeam(self, target, targetCampType, null)); }
/// <summary> /// tag 로 씬에 있는 targetobject 를 가져 온다. /// </summary> /// by yg. public List <GameObject> GetTargetObjects(TargetTag tag) { return(targetObjects.FindTargets(tag)); }
public static bool CheckTag(GameObject target, TargetTag targetTag) { return(target != null && TagManager.CheckTagType(target.tag, targetTag)); }
public override string ToDebugString() { return($"{ToolBox.GetDebugSymbol(HasBeenDetermined())} {nameof(CheckAfflictionAction)} -> (TargetTag: {TargetTag.ColorizeObject()}, " + $"AfflictionIdentifier: {Identifier.ColorizeObject()}, " + $"TargetLimb: {TargetLimb.ColorizeObject()}, " + $"Succeeded: {succeeded.ColorizeObject()})"); }
static void Main(string[] args) { try { // Connect to the reader. // Pass in a reader hostname or IP address as a // command line argument when running the example if (args.Length != 1) { Console.WriteLine("Error: No hostname specified. Pass in the reader hostname as a command line argument when running the Sdk Example."); return; } string hostname = args[0]; reader.Connect(hostname); // Assign the TagOpComplete event handler. // This specifies which method to call // when tag operations are complete. reader.TagOpComplete += OnTagOpComplete; // Configure the reader with the default settings. reader.ApplyDefaultSettings(); // Create a tag operation sequence. // You can add multiple read, write, lock, kill and QT // operations to this sequence. TagOpSequence seq = new TagOpSequence(); // Specify a target tag. // This is very important, since a kill operation is irreversible. target = new TargetTag(); // Select a target tag based on the EPC. target.MemoryBank = MemoryBank.Epc; target.BitPointer = BitPointers.Epc; // The EPC of the target tag. target.Data = TARGET_EPC; // Apply the target tag to the tag operation sequence. seq.TargetTag = target; // Define a tag write operation that sets the kill password. // Tags cannot be killed with a zero password, so we must // set the password to a non-zero value first. TagWriteOp writeOp = new TagWriteOp(); // Assumes that current access password is not set // (zero is the default) writeOp.AccessPassword = null; // The kill password is in the Reserved memory bank. writeOp.MemoryBank = MemoryBank.Reserved; // A pointer to the start of the kill password. writeOp.WordPointer = WordPointers.KillPassword; // The new kill password to write. writeOp.Data = TagData.FromHexString(KILL_PW); // Add this tag write op to the tag operation sequence. seq.Ops.Add(writeOp); // Add the tag operation sequence to the reader. // The reader supports multiple sequences. reader.AddOpSequence(seq); // Start the reader reader.Start(); // Wait for the user to press enter. Console.WriteLine("Press enter to exit."); Console.ReadLine(); // Stop reading. reader.Stop(); // Disconnect from the reader. reader.Disconnect(); } catch (OctaneSdkException e) { // Handle Octane SDK errors. Console.WriteLine("Octane SDK exception: {0}", e.Message); } catch (Exception e) { // Handle other .NET errors. Console.WriteLine("Exception : {0}", e.Message); } }
public void Parse(SysSkillMainVo skillAttr) { if (StringUtils.CheckValid(skillAttr.ConjureRangetype)) { this.IsUseSkillPointer = true; string[] array = skillAttr.ConjureRangetype.Split(new char[] { '|' }); if (array.Length > 0) { string text = array[0]; switch (text) { case "1": if (array.Length == 3) { this.SkillPointerType = SkillPointerType.RectanglePointer; this.PointerLength = float.Parse(array[1]); this.PointerWidth = float.Parse(array[2]); } break; case "2": if (array.Length == 2) { this.SkillPointerType = SkillPointerType.CirclePointer; this.PointerRadius = float.Parse(array[1]); } break; case "3": if (array.Length == 3) { this.SkillPointerType = SkillPointerType.SectorPointer; this.PointerRadius = float.Parse(array[1]); this.SectorPointerAngle = float.Parse(array[2]); } break; } } } this.logicType = (SkillLogicType)skillAttr.skill_logic_type; string str = Convert.ToString(skillAttr.need_target); int[] stringToInt = StringUtils.GetStringToInt(str, '|'); if (stringToInt != null && stringToInt.Length > 0) { this.needTarget = (stringToInt[0] != 0); } if (stringToInt != null && stringToInt.Length > 1) { this.skillCastingType = stringToInt[1]; } this.skill_prop = skillAttr.skill_prop; if (StringUtils.CheckValid(skillAttr.skill_mutex)) { this.skillMutexs = StringUtils.GetStringValue(skillAttr.skill_mutex, ','); } if (StringUtils.CheckValid(skillAttr.guide_time)) { string[] stringValue = StringUtils.GetStringValue(skillAttr.guide_time, '|'); this.isGuide = (stringValue != null && float.Parse(stringValue[0]) > 0f); this.guideTime = ((!this.isGuide) ? 0f : float.Parse(stringValue[1])); this.guideInterval = ((!this.isGuide) ? 0f : float.Parse(stringValue[2])); if (stringValue.Length > 3 && this.isGuide) { this.isShowGuideBar = (int.Parse(stringValue[3]) != 0); } this.interrupt = (skillAttr.interrupt != 0); } if (StringUtils.CheckValid(skillAttr.cost)) { this.cost_ids = StringUtils.GetStringToInt(skillAttr.cost, ','); } if (StringUtils.CheckValid(skillAttr.target_type)) { int[] stringToInt2 = StringUtils.GetStringToInt(skillAttr.target_type, '|'); this.targetCamp = (SkillTargetCamp)((stringToInt2 == null) ? 0 : stringToInt2[0]); this.targetTag = (TargetTag)((stringToInt2.Length <= 1) ? 0 : stringToInt2[1]); } if (StringUtils.CheckValid(skillAttr.effective_range)) { string[] stringValue2 = StringUtils.GetStringValue(skillAttr.effective_range, ','); if (stringValue2.Length > 0) { float[] stringToFloat = StringUtils.GetStringToFloat(stringValue2[0], '|'); this.effectiveRangeType = (this.selectRangeType = ((stringToFloat == null) ? EffectiveRangeType.None : ((EffectiveRangeType)stringToFloat[0]))); this.effectRange1 = (this.selectRange1 = ((stringToFloat.Length <= 1) ? 0f : stringToFloat[1])); this.effectRange2 = (this.selectRange2 = ((stringToFloat.Length <= 2) ? 0f : stringToFloat[2])); } if (stringValue2.Length > 1) { float[] stringToFloat2 = StringUtils.GetStringToFloat(stringValue2[1], '|'); this.selectRangeType = ((stringToFloat2 == null) ? EffectiveRangeType.None : ((EffectiveRangeType)stringToFloat2[0])); this.selectRange1 = ((stringToFloat2.Length <= 1) ? 0f : stringToFloat2[1]); this.selectRange2 = ((stringToFloat2.Length <= 2) ? 0f : stringToFloat2[2]); } } this.isAbsorbMp = false; this.isDiJianWoZeng = false; this.damageProbability = 100f; this.isCanMoveInSkillCastin = false; this.isMoveSkill = false; if (StringUtils.CheckValid(skillAttr.skill_mutex)) { string[] stringValue3 = StringUtils.GetStringValue(skillAttr.skill_mutex, ','); for (int i = 0; i < stringValue3.Length; i++) { string[] stringValue4 = StringUtils.GetStringValue(stringValue3[i], '|'); if (stringValue4[0] == "1") { this.damageProbability = (float)int.Parse(stringValue4[1]); } else if (stringValue4[0] == "2") { if (stringValue4[1] == "1") { this.isAbsorbMp = true; } else if (stringValue4[1] == "0") { this.isAbsorbMp = false; } } else if (stringValue4[0] == "3") { if (stringValue4[1] == "1") { this.isDiJianWoZeng = true; } else if (stringValue4[1] == "0") { this.isDiJianWoZeng = false; } } else if (stringValue4[0] == "4") { if (stringValue4[1] == "1") { this.isCanMoveInSkillCastin = true; } else if (stringValue4[1] == "0") { this.isCanMoveInSkillCastin = false; } } else if (stringValue4[0] == "6") { if (stringValue4[1] == "1") { this.continueMoveAfterSkillEnd = true; } else if (stringValue4[1] == "0") { this.continueMoveAfterSkillEnd = false; } } else if (stringValue4[0] == "7") { if (stringValue4[1] == "1") { this.isMoveSkill = true; } else if (stringValue4[1] == "0") { this.isMoveSkill = false; } } } } if (StringUtils.CheckValid(skillAttr.ready_action_ids)) { this.ready_actions = StringUtils.GetStringValue(skillAttr.ready_action_ids, ','); } if (StringUtils.CheckValid(skillAttr.start_action_ids)) { string[] stringValue5 = StringUtils.GetStringValue(skillAttr.start_action_ids, ','); List <string> list = new List <string>(); List <string> list2 = new List <string>(); for (int j = 0; j < stringValue5.Length; j++) { string[] stringValue6 = StringUtils.GetStringValue(stringValue5[j], '|'); if (stringValue6.Length == 2) { if (stringValue6[0] == "1") { list.Add(stringValue6[1]); } else if (stringValue6[0] == "2") { list2.Add(stringValue6[1]); } } else if (stringValue6.Length == 1) { list.Add(stringValue6[0]); } } this.start_actions = list.ToArray(); this.crit_start_actions = list2.ToArray(); } if (StringUtils.CheckValid(skillAttr.hit_action_ids)) { string[] stringValue7 = StringUtils.GetStringValue(skillAttr.hit_action_ids, ','); List <string> list3 = new List <string>(); List <string> list4 = new List <string>(); List <string> list5 = new List <string>(); for (int k = 0; k < stringValue7.Length; k++) { string[] stringValue8 = StringUtils.GetStringValue(stringValue7[k], '|'); if (stringValue8.Length == 2) { if (stringValue8[0] == "1") { list3.Add(stringValue8[1]); } else if (stringValue8[0] == "2") { list4.Add(stringValue8[1]); } else if (stringValue8[0] == "3") { list5.Add(stringValue8[1]); } } else if (stringValue8.Length == 1) { list3.Add(stringValue8[0]); } } this.hit_actions = list3.ToArray(); this.crit_hit_actions = list4.ToArray(); this.friend_hit_actions = list5.ToArray(); } if (StringUtils.CheckValid(skillAttr.end_action_ids)) { this.end_actions = StringUtils.GetStringValue(skillAttr.end_action_ids, ','); } if (StringUtils.CheckValid(skillAttr.init_higheff_ids)) { this.init_higheff_ids = StringUtils.GetStringValue(skillAttr.init_higheff_ids, ','); } if (StringUtils.CheckValid(skillAttr.start_higheff_ids)) { this.start_higheff_ids = StringUtils.GetStringValue(skillAttr.start_higheff_ids, ','); } if (StringUtils.CheckValid(skillAttr.hit_higheff_ids)) { this.hit_higheff_ids = StringUtils.GetStringValue(skillAttr.hit_higheff_ids, ','); } if (StringUtils.CheckValid(skillAttr.start_buff_ids)) { this.start_buff_ids = StringUtils.GetStringValue(skillAttr.start_buff_ids, ','); } if (StringUtils.CheckValid(skillAttr.hit_buff_ids)) { this.hit_buff_ids = StringUtils.GetStringValue(skillAttr.hit_buff_ids, ','); } if (StringUtils.CheckValid(skillAttr.skill_phase)) { string[] stringValue9 = StringUtils.GetStringValue(skillAttr.skill_phase, ','); if (stringValue9 != null && stringValue9.Length == 3) { this.castBefore = float.Parse(stringValue9[0]); this.castIn = float.Parse(stringValue9[1]); this.castEnd = float.Parse(stringValue9[2]); } } if (this.config.skill_type == 1) { this.interruptBefore = SkillInterruptType.Force; } else if (this.config.skill_type == 2) { this.interruptBefore = SkillInterruptType.Passive; } this.interruptIn = (SkillInterruptType)this.config.interrupt; this.interruptEnd = SkillInterruptType.Force; if (StringUtils.CheckValid(skillAttr.hit_time)) { this.hitTimes = StringUtils.GetStringToFloat(skillAttr.hit_time, ','); } if (StringUtils.CheckValid(skillAttr.damage_id)) { this.damage_ids = StringUtils.GetStringToInt(skillAttr.damage_id, ','); } if (StringUtils.CheckValid(skillAttr.skill_unique)) { int[] stringToInt3 = StringUtils.GetStringToInt(skillAttr.skill_unique, '|'); if (stringToInt3 != null && stringToInt3.Length == 2) { this.m_nSkillUnique = stringToInt3[0]; this.m_nPriority = stringToInt3[1]; } } }
public override string ToDebugString() { string subActionStr = ""; if (succeeded.HasValue) { subActionStr = $"\n Sub action: {(succeeded.Value ? Success : Failure)?.CurrentSubAction.ColorizeObject()}"; } return($"{ToolBox.GetDebugSymbol(DetermineFinished())} {nameof(CheckItemAction)} -> (TargetTag: {TargetTag.ColorizeObject()}, " + $"ItemIdentifiers: {ItemIdentifiers.ColorizeObject()}" + $"Succeeded: {(succeeded.HasValue ? succeeded.Value.ToString() : "not determined").ColorizeObject()})" + subActionStr); }