public override void Init(BaseMonoEntity entity) { this.prop = (BaseMonoPropObject)entity; this.config = this.prop.config; base.commonConfig = this.config.CommonConfig; base.Init(entity); for (int i = 0; i < this.config.Abilities.Length; i++) { ConfigEntityAbilityEntry entry = this.config.Abilities[i]; base.appliedAbilities.Add(Tuple.Create <ConfigAbility, Dictionary <string, object> >(AbilityData.GetAbilityConfig(entry.AbilityName, entry.AbilityOverride), new Dictionary <string, object>())); } if (this.config.PropArguments.IsTriggerField) { this._triggerFieldPlugin = new ActorTriggerFieldPlugin(this); base.AddPlugin(this._triggerFieldPlugin); } for (int j = 0; j < 0x1b; j++) { AbilityState state = (AbilityState)(((int)1) << j); if (((state & (AbilityState.Undamagable | AbilityState.MaxMoveSpeed | AbilityState.Immune | AbilityState.CritUp | AbilityState.Shielded | AbilityState.PowerUp | AbilityState.AttackSpeedUp | AbilityState.MoveSpeedUp | AbilityState.Endure)) != AbilityState.None) || ((state & (AbilityState.Tied | AbilityState.TargetLocked | AbilityState.Fragile | AbilityState.Weak | AbilityState.AttackSpeedDown | AbilityState.MoveSpeedDown | AbilityState.Frozen | AbilityState.Poisoned | AbilityState.Burn | AbilityState.Paralyze | AbilityState.Stun | AbilityState.Bleed)) != AbilityState.None)) { base.SetAbilityStateImmune(state, true); } } Singleton <EventManager> .Instance.RegisterEventListener <EvtLevelBuffState>(base.runtimeID); this._opacity = 1f; }
public static void PvPSelectRemoteAvatar(BaseMonoAvatar aAvatar) { List <BaseMonoAvatar> allAvatars = Singleton <AvatarManager> .Instance.GetAllAvatars(); List <BaseMonoPropObject> allPropObjects = Singleton <PropObjectManager> .Instance.GetAllPropObjects(); if ((allAvatars.Count != 0) || (allPropObjects.Count != 0)) { Vector3 forward = Singleton <CameraManager> .Instance.GetMainCamera().Forward; if (aAvatar.GetActiveControlData().hasSteer) { forward = aAvatar.GetActiveControlData().steerDirection; } forward.y = 0f; float eccentricity = 0.9f; BaseMonoEntity monsterTarget = null; float maxValue = float.MaxValue; FilterAvatarTargetByEllipse(aAvatar, allAvatars, forward, eccentricity, ref monsterTarget, ref maxValue); BaseMonoEntity newTarget = null; float num3 = float.MaxValue; for (int i = 0; i < allPropObjects.Count; i++) { BaseMonoPropObject entity = allPropObjects[i]; if ((entity.IsActive() && !entity.denySelect) && Singleton <CameraManager> .Instance.GetMainCamera().IsEntityVisible(entity)) { float num5 = 1.5f * GetScoreByEllipse(aAvatar, entity, forward, eccentricity); if (num5 < num3) { newTarget = entity; num3 = num5; } } } if ((monsterTarget == null) || (newTarget == null)) { if (monsterTarget != null) { aAvatar.SetAttackTarget(monsterTarget); } else if (newTarget != null) { aAvatar.SetAttackTarget(newTarget); } else { aAvatar.SetAttackTarget(null); } } else { BaseMonoEntity entity3 = (maxValue >= num3) ? newTarget : monsterTarget; aAvatar.SetAttackTarget(entity3); } } }
public void RemoveAllRemovables() { for (int i = 0; i < this._propLs.Count; i++) { BaseMonoPropObject obj2 = this._propLs[i]; if (obj2.IsToBeRemove()) { this.RemovePropObjectByRuntimeID(obj2.GetRuntimeID(), i); i--; } } }
public void RemoveAllPropObjects() { for (int i = 0; i < this._propLs.Count; i++) { BaseMonoPropObject obj2 = this._propLs[i]; if (!obj2.IsToBeRemove()) { obj2.SetDied(KillEffect.KillImmediately); } this.RemovePropObjectByRuntimeID(obj2.GetRuntimeID(), i); i--; } }
private bool OnPostPropObjectCreated(EvtPropObjectCreated evt) { if (evt.objectID == this._stopWorldOwnerID) { return(false); } BaseMonoPropObject target = Singleton <PropObjectManager> .Instance.TryGetPropObjectByRuntimeID(evt.objectID); if (target != null) { this.ApplyStopEffectOn(target); } return(true); }
public uint CreatePropObject(uint ownerID, string propName, float HP, float attack, Vector3 initPos, Vector3 initDir, bool appearAnim = false) { ConfigPropObject propObjectConfig = PropObjectData.GetPropObjectConfig(propName); BaseMonoPropObject component = UnityEngine.Object.Instantiate <GameObject>(Miscs.LoadResource <GameObject>(propObjectConfig.PrefabPath, BundleType.RESOURCE_FILE)).GetComponent <BaseMonoPropObject>(); uint nextRuntimeID = Singleton <RuntimeIDManager> .Instance.GetNextRuntimeID(7); component.transform.position = initPos; component.transform.forward = initDir; component.Init(ownerID, nextRuntimeID, propObjectConfig.Name, appearAnim); if ((propName == "JokeBox") && (attack <= 0f)) { (component as MonoBarrelProp)._toExplode = false; } this._propObjects.Add(nextRuntimeID, component); this._propLs.Add(component); PropObjectActor actor = Singleton <EventManager> .Instance.CreateActor <PropObjectActor>(component); actor.ownerID = ownerID; actor.InitProp(HP, attack); actor.PostInit(); return(nextRuntimeID); }