private void InitFilter() { Filter = new UnitFilter(); ComplexFilterParams = new UnitFilterParams(); var unitTypeRepository = new UnitTypeRepository(); FilterUnitTypeList = unitTypeRepository.GetAll(type => type.TypeName); var repository = Repository as UnitRepository; if (repository != null) { FilterManufactureList = repository.GetManufactureList(); FilterModelNameList = repository.GetModelList(); } var ownerRepository = new OwnerRepository(); FilterOwnerList = ownerRepository.GetAll(owner => owner.Name.DisplayName); var statusRepository = new StatusRepository(); FilterStatusList = statusRepository.GetAll(x => x.StatusType); }
public Unit FindUnit(UnitFilter filter) { foreach (var item in m_units) { if (filter(item)) { return(item); } } return(null); }
//spell 1 ChillingSlash #region <ChillingSlash> private Action <UnitEventArgs>[] ChillingSlash() { #region <ChillingSlash/Init> var eventGroup = new Action <UnitEventArgs> [(int)UnitEventType.Count]; #endregion #region <ChillingSlash/Begin> eventGroup[(int)UnitEventType.Begin] = eventArgs => { var caster = (Computer)eventArgs.Caster; var focus = caster.Focus; caster.ChaseOrRush(focus, .2f, 2.0f); caster.UnitBoneAnimator.SetCast("Spell", caster.hyperParameterSet[(int)HyperParameterOfSpell.Spell01].Motion); }; #endregion #region <ChillingSlash/Exit> eventGroup[(int)UnitEventType.Exit] = eventArgs => { var caster = (Computer)eventArgs.Caster; var list = new PreProcessedMonoBehaviour[64].ToList(); UnitFilter.GetUnitAtLocation(caster.GetPosition, 5f, caster, UnitFilter.Condition.IsNegative, list); var numberOfUnit = UnitFilter.GetUnitInCircularSector(caster, 90f, FilteredObjectGroup, list); for (var i = 0; i < numberOfUnit; i++) { var target = (Unit)FilteredObjectGroup[i]; if (UnitFilter.Check(caster, target, UnitFilter.Condition.IsOrCondition | UnitFilter.Condition.IsDead | UnitFilter.Condition.IsInvincible)) { continue; } if (target != null) { target.Hurt(caster, hyperParameterSet[(int)HyperParameterOfSpell.Spell01].Damage, TextureType.Magic); } } }; #endregion #region <ChillingSlash/Terminate> eventGroup[(int)UnitEventType.End] = other => { var caster = (Computer)other.Caster; caster.ResetFromCast(); }; #endregion return(eventGroup); }
public static List <NoxUnit> GetUnitList(UnitFilter filter) { List <NoxUnit> lis = new List <NoxUnit>(); foreach (NoxUnit nu in NoxUnit.Indexer.Values) { if (filter.Invoke(nu)) { lis.Add(nu); } } return(lis); }
private void FilterMethod() { var filter = ComplexFilterParams as UnitFilterParams; if (filter != null) { Filter = new UnitFilter(filter); IsSearched = true; if (RefreshCommand != null) { RefreshCommand.Execute(null); } } }
private void FillFilter() { var filterParams = ComplexFilterParams as UnitFilterParams; if (filterParams != null) { filterParams.UnitType = new List <UnitType>(); filterParams.Status = new List <Status>(); filterParams.Owner = new List <Owner>(); filterParams.ModelName = new List <string>(); filterParams.Manufacture = new List <string>(); Filter = new UnitFilter(filterParams); } }
private void ClearFilterMethod() { Filter = new UnitFilter(); ComplexFilterParams = new UnitFilterParams(); InitFilter(); if (string.IsNullOrEmpty(SearchString)) { IsSearched = false; } if (RefreshCommand != null) { RefreshCommand.Execute(null); } }
public bool ReleaseItem() { if (PlayerItemManager.GetInstance.WaveStone < EquipItem.ReleaseCost || EquipItem.Release) { return(false); } PlayerItemManager.GetInstance.WaveStone -= EquipItem.ReleaseCost; EquipItem.SetRelease(true); _icon.color = Color.white; _itemHighlight.Stop(); UIFontManager.GetInstance.Pooling(_releaseCost); #region <FX> SoundManager.GetInstance.PlaySfx(K514SfxStorage.CommonType.Release); VfxManager.GetInstance.CreateVfx(VfxManager.Type.ItemRelease, PlayerChampionHandler.GetInstance.Handle.GetPosition, true); UnitFilter.GetUnitAtPlaneCircle(PlayerChampionHandler.GetInstance.Handle.GetPosition, 8.0f, PlayerChampionHandler.GetInstance.Handle, UnitFilter.Condition.IsAliveNegative, PlayerChampionHandler.GetInstance.Handle.InteractUnitGroup); foreach (var FilteredUnit in PlayerChampionHandler.GetInstance.Handle.InteractUnitGroup) { if (FilteredUnit == null) { break; } var unit = (Unit)FilteredUnit; var direction = unit.GetPosition - PlayerChampionHandler.GetInstance.Handle.GetPosition; unit.AddForce(direction.normalized * Mathf.Min(40 / direction.magnitude, 8.0f), true, true); var damageStruct = new DamagePreset(); damageStruct.SetCaster(PlayerChampionHandler.GetInstance.Handle); damageStruct.SetDamage(1); damageStruct.SetFlags(p_IsCastHitMotion: true); damageStruct.SetKnock(4); unit.Hurt(damageStruct); } #endregion return(true); }
//spell 6 BoneExplosion #region <BoneExplosion> private Action <UnitEventArgs>[] BoneExplosion() { #region <BoneExplosion/Init> var eventGroup = new Action <UnitEventArgs> [(int)UnitEventType.Count]; #endregion #region <BoneExplosion/Begin> eventGroup[(int)UnitEventType.Begin] = eventArgs => { var caster = (Computer)eventArgs.Caster; if (!boneWall.IsActive) { caster.ResetFromCast(); return; } var focus = caster.Focus; caster.UnitBoneAnimator.SetCast("Spell", caster.hyperParameterSet[(int)HyperParameterOfSpell.Spell06].Motion); }; #endregion #region <BoneExplosion/Cue> eventGroup[(int)UnitEventType.Cue] = eventArgs => { var caster = (Computer)eventArgs.Caster; boneWall.Remove(); VfxManager.GetInstance.CreateVfx(VfxManager.Type.BoneExplosion, caster.GetPosition) .SetLifeSpan(1f) .SetScale(1f) .SetTrigger(); UnitFilter.GetUnitAtLocation(caster.GetPosition, caster.hyperParameterSet[(int)HyperParameterOfSpell.Spell06].Range, caster, UnitFilter.Condition.IsAlive, FilteredObjectGroup); foreach (var obj in FilteredObjectGroup) { var target = (Unit)obj; if (UnitFilter.Check(caster, target, UnitFilter.Condition.IsOrCondition | UnitFilter.Condition.IsDead | UnitFilter.Condition.IsInvincible)) { continue; } if (target != null) { target.Hurt(caster, hyperParameterSet[(int)HyperParameterOfSpell.Spell06].Damage, TextureType.Magic); } } }; #endregion #region <BoneExplosion/Terminate> eventGroup[(int)UnitEventType.End] = other => { var caster = (Computer)other.Caster; caster.ResetFromCast(); }; #endregion return(eventGroup); }
//spell 3 ShadowDive #region <ShadowDive> private Action <UnitEventArgs>[] ShadowDive() { #region <ShadowDive/Init> var eventGroup = new Action <UnitEventArgs> [(int)UnitEventType.Count]; #endregion #region <ShadowDive/Begin> eventGroup[(int)UnitEventType.Begin] = eventArgs => { var caster = (Computer)eventArgs.Caster; var focus = caster.Focus; caster.UnitBoneAnimator.SetCast("Spell", caster.hyperParameterSet[(int)HyperParameterOfSpell.Spell03].Motion); }; #endregion #region <ShadowDive/Standby> eventGroup[(int)UnitEventType.Standby] = eventArgs => { var caster = (Computer)eventArgs.Caster; var focus = caster.Focus; caster.ChaseOrRush(focus, 0.5f, .0f); }; #endregion #region <ShadowDive/Cue> eventGroup[(int)UnitEventType.Cue] = eventArgs => { var caster = (Computer)eventArgs.Caster; UnitFilter.GetUnitAtLocation(caster.GetPosition, 8.0f, caster, UnitFilter.Condition.IsNegative, FilteredObjectGroup); VfxManager.GetInstance.CreateVfx(VfxManager.Type.BloodCutter, caster.GetPosition) .SetLifeSpan(1f) .SetScale(2f) .SetTrigger(); foreach (var unit in FilteredObjectGroup) { var target = (Unit)unit; if (UnitFilter.Check(caster, target, UnitFilter.Condition.IsOrCondition | UnitFilter.Condition.IsDead | UnitFilter.Condition.IsInvincible)) { continue; } if (target != null) { target.Hurt(caster, hyperParameterSet[(int)HyperParameterOfSpell.Spell03].Damage, TextureType.Magic); } } }; #endregion #region <ShadowDive/Terminate> eventGroup[(int)UnitEventType.End] = other => { var caster = (Computer)other.Caster; caster.ResetFromCast(); }; #endregion return(eventGroup); }
static UnitFilter() { Instance = new UnitFilter(); Reset(); }
public virtual void Hurt(Unit caster, int damage, TextureType type, Vector3 forceDirection, Action <Unit, Unit, Vector3> action = null) { if (UnitFilter.Check(this, UnitFilter.Condition.IsDead) | UnitFilter.Check(this, UnitFilter.Condition.IsInvincible)) { return; } // TODO<Carey>: if (Verifying Of The Condition Of Hurt) if (true) { CurrentHealthPoint -= damage; MaterialApplier.SetTrigger(K514MaterialStorage.MAT_STATE.kHitted); if (action == null) { /* case */ /* * switch (type) * { * case TextureType.None: * switch (type) * { * case TextureType.None: * break; * case TextureType.Light: * break; * case TextureType.Medium: * break; * case TextureType.Heavy: * break; * case TextureType.Universal: * break; * default: * throw new ArgumentOutOfRangeException("type", type, null); * } * break; * case TextureType.Light: * break; * case TextureType.Medium: * break; * case TextureType.Heavy: * break; * case TextureType.Universal: * break; * default: * throw new ArgumentOutOfRangeException("type", type, null); * } */ } else { action(caster, this, forceDirection); } if (CurrentHealthPoint <= 0) { OnDeath(); } } // forceDirection.Normalize(); // AddForce(forceDirection * damage); // // var lFxTypeIndex = caster.FxAttackType.Length > (int) TriggerId ? // caster.FxAttackType[TriggerId] : K514VfxManager.ParticleType.PSpark; // var lVfx = K514VfxManager.GetInstance.CastVfx(lFxTypeIndex,CalculateHittedOffset(pStrikeTo)); // if (pVfxChainProperty != null) pVfxChainProperty(lVfx); // lVfx.SetTrigger(); }
private bool CheckCollisionAboutUnit(Action <CommomActionArgs> p_ActionWhenOccurCollision = null, bool decreaseHitNum = true) { if (!_isIgnoreUnit) { if (p_ActionWhenOccurCollision == null) { return(false); } CollidedUnitGroup.Clear(); _overLapCollideNumber = CheckCollisionWithCast(CastHitGroup, _halfExtents, PeekedNestPosition, UnitColliderLayerMask, Transform.position); _castHitNumber = CheckCollisionWithOverlap(ColliderGroup, _halfExtents, UnitColliderLayerMask, Transform.position); var l_loopCount = Mathf.Min(Mathf.Max(_overLapCollideNumber, _castHitNumber), _maxColliderNumber); var ignoreFilterMask = UnitFilter.Condition.IsPositive; if (!_IsCheckInvincible) { ignoreFilterMask |= UnitFilter.Condition.IsOrCondition | UnitFilter.Condition.IsInvincible; } for (var index = 0; index < l_loopCount; index++) { #region <CollisionCheckByHitCast> if (index >= _overLapCollideNumber) { goto SECTION_HIT_CHECK_OVER; } var hittedUnit = CastHitGroup[index].collider.GetComponent <Unit>(); if (UnitFilter.Check(Caster, hittedUnit, ignoreFilterMask)) { goto SECTION_HIT_CHECK_OVER; } foreach (var collided in ExCollidedUnitGroup) { if (UnitFilter.Check(collided, hittedUnit, ignoreFilterMask)) { goto SECTION_HIT_CHECK_OVER; } } ExCollidedUnitGroup.Add(hittedUnit); CollidedUnitGroup.Add(hittedUnit); SECTION_HIT_CHECK_OVER: #endregion #region <CollisionCheckbyOverlap> if (index >= _castHitNumber) { goto SECTION_COLLIDE_CHECK_OVER; } var collidedUnit = ColliderGroup[index].GetComponent <Unit>(); if (UnitFilter.Check(Caster, collidedUnit, ignoreFilterMask)) { goto SECTION_COLLIDE_CHECK_OVER; } foreach (var exCollided in ExCollidedUnitGroup) { if (UnitFilter.Check(exCollided, collidedUnit, ignoreFilterMask)) { goto SECTION_COLLIDE_CHECK_OVER; } } ExCollidedUnitGroup.Add(collidedUnit); CollidedUnitGroup.Add(collidedUnit); SECTION_COLLIDE_CHECK_OVER :; #endregion } // CASE#2: has been collided on any negative unit. if (CollidedUnitGroup.Count > 0) { // Defined Action: Collided Unit. p_ActionWhenOccurCollision(new CommomActionArgs() .SetMorphable(this) ); if (!decreaseHitNum) { ExCollidedUnitGroup.Clear(); } else if (_maxNumberOfHitTime > 1) { _maxNumberOfHitTime--; ExCollidedUnitGroup.Clear(); } return(true); } } return(false); }