Exemple #1
0
        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;
        }
Exemple #2
0
 public void Init(uint ownerID, uint runtimeID, string propName, bool appearAnim = false)
 {
     this.config       = PropObjectData.GetPropObjectConfig(propName);
     base.commonConfig = this.config.CommonConfig;
     this.Init(runtimeID);
     this._timeScaleStack = new FixedStack <float>(8, null);
     this._timeScaleStack.Push(1f, true);
     if ((Singleton <LevelManager> .Instance != null) && (Singleton <LevelManager> .Instance.levelEntity != null))
     {
         this._timeScale = this._lastTimeScale = this._timeScaleStack.value * Singleton <LevelManager> .Instance.levelEntity.TimeScale;
     }
     else
     {
         this._timeScale = this._lastTimeScale = this._timeScaleStack.value;
     }
     if (Singleton <EventManager> .Instance != null)
     {
         this.owner = (BaseMonoAbilityEntity)Singleton <EventManager> .Instance.GetEntity(ownerID);
     }
     if ((this.config.PropArguments != null) && !this.config.PropArguments.IsTargetable)
     {
         base.SetCountedDenySelect(true, true);
     }
     if ((this.config.PropArguments != null) && (this.config.PropArguments.Duration > 0f))
     {
         base.StartCoroutine(this.WaitDestroyByDuration(this.config.PropArguments.Duration));
     }
     if (appearAnim)
     {
         this.Appear();
     }
 }
        private void CreateLevelProp(string propName)
        {
            ConfigPropObject propObjectConfig = PropObjectData.GetPropObjectConfig(propName);
            float            hP       = propObjectConfig.PropArguments.HP;
            float            attack   = propObjectConfig.PropArguments.Attack;
            Vector3          position = this.collideCenterTransform.position;

            position.y = 0f;
            Singleton <PropObjectManager> .Instance.CreatePropObject(this.owner.GetRuntimeID(), propName, hP, attack, position, this.collideCenterTransform.forward, false);
        }
Exemple #4
0
        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);
        }