void PlayEffect(int effect_idx, float delay = 0)
		{
			if(m_current_active_effect != null)
			{
	#if !UNITY_3_5
				m_current_active_effect.gameObject.SetActive(false);
	#else			
				m_current_active_effect.gameObject.SetActiveRecursively(false);
	#endif
			}
				
			m_current_active_effect = m_effects[effect_idx].m_effect_sync;
			
	#if !UNITY_3_5
				m_current_active_effect.gameObject.SetActive(true);
	#else		
			m_current_active_effect.gameObject.SetActiveRecursively(true);
	#endif
			
			if(m_force_effects_to_origin)
			{
				m_current_active_effect.transform.localPosition = m_effects[effect_idx].m_position_offset;
			}
			
			m_current_active_effect.PlayAnimation(delay);
		}
    public ParticleEffectInstanceManager(EffectManager effect_manager, Mesh character_mesh, bool letter_flipped, ParticleEffectSetup effect_setup, AnimationProgressionVariables progression_vars, AnimatePerOptions animate_per, ParticleEmitter particle_emitter = null, ParticleSystem particle_system = null)
    {
        m_particle_emitter = particle_emitter;
        m_particle_system = particle_system;
        m_letter_mesh = character_mesh;
        m_letter_flipped = letter_flipped;
        m_follow_mesh = effect_setup.m_follow_mesh;
        m_duration = effect_setup.m_duration.GetValue(progression_vars, animate_per);
        m_delay = effect_setup.m_delay.GetValue(progression_vars, animate_per);
        m_position_offset = effect_setup.m_position_offset.GetValue(progression_vars, animate_per);
        m_rotation_offset = Quaternion.Euler(effect_setup.m_rotation_offset.GetValue(progression_vars, animate_per));
        m_rotate_with_letter = effect_setup.m_rotate_relative_to_letter;
        m_effect_manager_handle = effect_manager;
        m_active = false;

        if (m_particle_emitter != null)
        {
            m_transform = m_particle_emitter.transform;

            m_particle_emitter.emit = true;
            m_particle_emitter.enabled = false;
        }
        else if (m_particle_system != null)
        {
            m_transform = m_particle_system.transform;

            m_particle_system.playOnAwake = false;
            m_particle_system.Play();
        #if !UNITY_3_5 && UNITY_EDITOR
            p_system_timer = 0;
        #endif
        }
    }
Пример #3
0
 public virtual void Init()
 {
     m_EffectManager = new EffectManager();
     m_EffectManager.LoadEffect(m_Data.EffectPath);
     m_EffectManager.RegisterCondition("CanActiveEffect", CanActiveEffect);
     m_EffectManager.RegisterExcuteMethod("ExcuteEffect", ExcuteEffect);
 }
Пример #4
0
 void Awake()
 {
     gameManager = GameObject.Find("GameManager").GetComponent<GameManager>();
             soundManager = GameObject.Find("SoundManager").GetComponent<SoundManager>();
             effectManager = GameObject.Find("EffectManager").GetComponent<EffectManager>();
             common = GameObject.Find("Common").GetComponent<Common>();
 }
    public ParticleEffectInstanceManager(ParticleEmitter p_emitter, EffectManager effect_manager, Mesh character_mesh, float delay, float duration, Vector3 position_offset, bool follow_mesh)
    {
        m_emitter = p_emitter;
        m_duration = duration;
        m_letter_mesh = character_mesh;
        m_delay = delay;
        m_position_offset = position_offset;
        m_follow_mesh = follow_mesh;
        m_effect_manager_handle = effect_manager;
        m_transform = m_emitter.transform;

        // Enable emitter
        m_emitter.emit = true;
        m_emitter.enabled = false;

        // Position effect according to offset
        m_letter_mesh.RecalculateNormals();
        if(!m_letter_mesh.normals[0].Equals(Vector3.zero))
        {
            Quaternion rotation = Quaternion.LookRotation(m_letter_mesh.normals[0], m_letter_mesh.vertices[1].Equals(m_letter_mesh.vertices[2]) ? Vector3.forward : m_letter_mesh.vertices[1] - m_letter_mesh.vertices[2]);
            m_transform.position = m_effect_manager_handle.m_transform.position + (rotation * m_position_offset) + (m_letter_mesh.vertices[0] + m_letter_mesh.vertices[1] + m_letter_mesh.vertices[2] + m_letter_mesh.vertices[3]) / 4;
            m_transform.rotation = rotation;
        }
        else
        {
            m_transform.position = m_effect_manager_handle.m_transform.position + m_position_offset + (m_letter_mesh.vertices[0] + m_letter_mesh.vertices[1] + m_letter_mesh.vertices[2] + m_letter_mesh.vertices[3]) / 4;
        }
    }
Пример #6
0
 void Awake()
 {
     soundManager = GameObject.Find("SoundManager").GetComponent<SoundManager>();
             effectManager = GameObject.Find("EffectManager").GetComponent<EffectManager>();
             selecter = GameObject.Find("selecter").GetComponent<RectTransform>();
             common = GameObject.Find("Common").GetComponent<Common>();
 }
Пример #7
0
    void OnGUI()
    {
        m_effect_index = GUI.SelectionGrid(new Rect((Screen.width/2f) - (Screen.width/4f), 2f * (Screen.height/3f), Screen.width/2f, 7 * (Screen.height/24f)), m_effect_index, m_effect_names, 3);

        m_sync_toggle = GUI.Toggle(new Rect(5 * (Screen.width/6f), 11f * (Screen.height/12f), Screen.width/7f, Screen.height/13f), m_sync_toggle, "Sync?");

        if(GUI.changed)
        {
            // Effect change requested
            // Stop/Hide current effect
        #if !UNITY_3_5
            m_current_active_effect.gameObject.SetActive(false);
        #else
            m_current_active_effect.gameObject.SetActiveRecursively(false);
        #endif

            m_current_active_effect = m_sync_toggle ? m_effects[m_effect_index].m_effect_sync : m_effects[m_effect_index].m_effect_random;

        #if !UNITY_3_5
            m_current_active_effect.gameObject.SetActive(true);
        #else
            m_current_active_effect.gameObject.SetActiveRecursively(true);
        #endif
            m_current_active_effect.transform.localPosition = m_local_position;
            m_current_active_effect.PlayAnimation();
        }

        #if !UNITY_EDITOR || USE_EDITOR_GUI_NAVIGATION
        if(GUI.Button(new Rect((Screen.width/28f), 10.5f * (Screen.height/12f), Screen.width/7f, (Screen.height/13f)), "Back"))
        {
            PlayerPrefs.SetInt("TextFx_Skip_Intro_Anim", 1);
            Application.LoadLevel("TitleScene");
        }
        #endif
    }
Пример #8
0
    public SimpleButton(string title, float width, float height, SimpleButtonColor color, bool isPressTap,string fontName)
    {
        _isPressTap = isPressTap;
        this.effectManager = Core.topEffectManager;

        _color = color;
        AddChild(button = new FSliceButton(width,height,_color.path,_color.path));

        //button.SetPosition(0.25f,0.33f);//pixel perfect?

        AddChild(mainLabel = new DualLabel(fontName,title,Color.white,TOColors.TEXT_SHADOW));
        mainLabel.y = 2.5f;

        if(_isPressTap)
        {
            button.SignalPress += (b) => DoTap();
        }
        else
        {
            button.SignalRelease += (b) => DoTap();
        }

        _overHighlight = new FSliceSprite("UI/ButtonHighlight",width,height,12,12,12,12);
        _overHighlight.alpha = 0.45f;

        ListenForUpdate(HandleUpdate);

        UpdateEnabled();
    }
Пример #9
0
    void Awake()
    {
        Instance = this;

        _fisheye = playerCamera.gameObject.GetComponent<Fisheye>();
        _colorSaturation = playerCamera.gameObject.GetComponent<ColorCorrectionCurves>();
        _blur = playerCamera.gameObject.GetComponent<BlurOptimized>();
    }
 public MonoEnvironment()
 {
     OnDispose = () => { };
     EffectManager = new EffectManager();
     SkillManager = new SkillList();
     PropertyManager = new PropertyManager();
     PluginEnvironment = new PluginEnvironment();
     Attributes = new Attributes();
 }
Пример #11
0
    public static EffectManager Instance()
    {
        if (mEffectMgr == null)
        {
            mEffectMgr = new EffectManager();
        }

        return mEffectMgr;
    }
Пример #12
0
 public static EffectManager Instance()
 {
     if (!instance)
     {
         container = new GameObject();
         container.name = "EffectManager";
         instance = container.AddComponent(typeof(EffectManager)) as EffectManager;
     }
     return instance;
 }
Пример #13
0
	// Use this for initialization
	void Start () {
		Instance = this;

		if (EffectsOriginal == null)
						return;
		for(int i = 0; i < EffectsOriginal.Length; i++)
		{
			if(EffectsOriginal[i] != null)
				Effects.Add(EffectsOriginal[i].name, EffectsOriginal[i]);
		}
	}
Пример #14
0
 private void _SetInstance()
 {
     if (_Instance != null)
         {
             Debug.Log("cannot instantiate");
             Destroy(this.gameObject);
             return;
         }
         _Instance = this;
         //DontDestroyOnLoad(this);
 }
        public override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            #region Effect の初期化

            effectManager = new EffectManager(GraphicsDevice, Content);
            normalMapEffect = effectManager.Load<FluidSurfaceNormalMapEffect>();
            normalMapEffect.SampleOffset = new Vector2(1.0f / (float) TextureSize, 1.0f / (float) TextureSize);

            #endregion

            #region 内部で使用する RenderTarget の初期化

            backBufferManager = new BackBufferManager(GraphicsDevice);

            prevWaveMapBackBuffer = backBufferManager.Load("FluidSurfacePrevWaveMap");
            prevWaveMapBackBuffer.Width = TextureSize;
            prevWaveMapBackBuffer.Height = TextureSize;
            prevWaveMapBackBuffer.MipMap = true;
            prevWaveMapBackBuffer.SurfaceFormat = SurfaceFormat.Vector2;
            prevWaveMapBackBuffer.DepthFormat = DepthFormat.None;
            prevWaveMapBackBuffer.MultiSampleCount = 0;
            prevWaveMapBackBuffer.Enabled = true;

            waveMapBackBuffer = backBufferManager.Load("FluidSurfaceWaveMap");
            waveMapBackBuffer.Width = TextureSize;
            waveMapBackBuffer.Height = TextureSize;
            waveMapBackBuffer.MipMap = true;
            waveMapBackBuffer.SurfaceFormat = SurfaceFormat.Vector2;
            waveMapBackBuffer.DepthFormat = DepthFormat.None;
            waveMapBackBuffer.MultiSampleCount = 0;
            waveMapBackBuffer.Enabled = true;

            normalMapBackBuffer = backBufferManager.Load("FluidSurfaceNormalMap");
            normalMapBackBuffer.Width = TextureSize;
            normalMapBackBuffer.Height = TextureSize;
            normalMapBackBuffer.MipMap = true;
            normalMapBackBuffer.SurfaceFormat = SurfaceFormat.Vector2;
            normalMapBackBuffer.DepthFormat = DepthFormat.None;
            normalMapBackBuffer.MultiSampleCount = 0;
            normalMapBackBuffer.Enabled = true;

            prevWaveMapBackBuffer.Begin();
            {
                GraphicsDevice.Clear(Color.Black);
            }
            prevWaveMapBackBuffer.End();

            #endregion

            base.LoadContent();
        }
Пример #16
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Debug.LogError("Duplicate EffectManager");
        }

        DontDestroyOnLoad (this);
    }
    public UIItemController(UIItemData data)
    {
        m_Data = data;
        m_GameManager = TDCGameManager.GetInstance();
        m_Inventory = UIInventory.GetInstance();

        m_EffectManager = new EffectManager();
        m_EffectManager.LoadEffect(m_Data.EffectPath);
        m_EffectManager.RegisterCondition("CanActiveEffect", CanActiveEffect);

        m_EffectManager.RegisterExcuteMethod("PrintDebug", PrintDebug);
        m_EffectManager.RegisterExcuteMethod("CreateObjectEffect", CreateObjectEffect);
        m_EffectManager.RegisterExcuteMethod("DropItSelfEffect", DropItSelfEffect);
        m_EffectManager.RegisterExcuteMethod("AddValueEffect", AddValueEffect);
        m_EffectManager.RegisterExcuteMethod("SubtractValueEffect", SubtractValueEffect);
    }
Пример #18
0
    private VertexColour start_colour, end_colour; // Used to store the colours for each frame

    #endregion Fields

    #region Constructors

    public LetterSetup(string character, int letter_idx, Mesh mesh, Vector3 base_offset, ref CustomCharacterInfo char_info, int line_num, int word_idx, EffectManager effect_manager)
    {
        m_character = character;
        m_mesh = mesh;
        m_base_offset = base_offset;
        m_effect_manager_handle = effect_manager;

        m_progression_variables = new AnimationProgressionVariables(letter_idx, word_idx, line_num);

        m_anim_state_vars = new AnimationStateVariables();
        m_anim_state_vars.m_active_loop_cycles = new List<ActionLoopCycle>();

        SetupLetterMesh(ref char_info);

        if (m_flipped)
            // flip UV coords in x axis.
            m_mesh.uv = new[] { mesh.uv[3], mesh.uv[2], mesh.uv[1], mesh.uv[0] };
    }
Пример #19
0
    void Awake()
    {
        effectManager = GameObject.Find("EffectManager").GetComponent<EffectManager>();

        // 初始化键位与音频的对应关系
        keyboards = new Dictionary<KeyCode,string>(); // 实例化空字典
        keyboards[KeyCode.Q]      = "010";
        keyboards[KeyCode.Alpha2] = "015";
        keyboards[KeyCode.W]      = "020";
        keyboards[KeyCode.Alpha3] = "025";
        keyboards[KeyCode.E]      = "030";
        keyboards[KeyCode.R]      = "040";
        keyboards[KeyCode.Alpha5] = "045";
        keyboards[KeyCode.T]      = "050";
        keyboards[KeyCode.Alpha6] = "055";
        keyboards[KeyCode.Y]      = "060";
        keyboards[KeyCode.Alpha7] = "065";
        keyboards[KeyCode.U]      = "070";
        keyboards[KeyCode.I] = "110";
        keyboards[KeyCode.Alpha9] = "115";
        keyboards[KeyCode.O] = "120";
        keyboards[KeyCode.Alpha0] = "125";
        keyboards[KeyCode.P] = "130";
        keyboards[KeyCode.Z] = "140";
        keyboards[KeyCode.S] = "145";
        keyboards[KeyCode.X] = "150";
        keyboards[KeyCode.D] = "155";
        keyboards[KeyCode.C] = "160";
        keyboards[KeyCode.F] = "165";
        keyboards[KeyCode.V] = "170";
        keyboards[KeyCode.B] = "210";
        keyboards[KeyCode.H] = "215";
        keyboards[KeyCode.N] = "220";
        keyboards[KeyCode.J] = "225";
        keyboards[KeyCode.M] = "230";
        keyboards[KeyCode.Comma] = "240";
        keyboards[KeyCode.K] = "245";
        keyboards[KeyCode.Period] = "250";
        keyboards[KeyCode.L] = "255";
        keyboards[KeyCode.Slash] = "260";
        keyboards[KeyCode.Semicolon] = "265";
        keyboards[KeyCode.RightShift] = "270";
    }
Пример #20
0
    public Core()
    {
        instance = this;

        AddChild(pageContainer = new FContainer());
        AddChild(topEffectManager = new EffectManager(true));

        audioManager = new AudioManager();
        FXPlayer.manager = audioManager.fxManager;
        MusicPlayer.manager = audioManager.musicManager;
        FXPlayer.Preload();

        playerManager = new PlayerManager();

        playerManager.Setup();

        ShowPage(new PlayerSelectPage());

        ListenForUpdate(Update);
    }
Пример #21
0
        public Visualizer( D3D10Wrapper d3d, EffectManager effectManager )
        {
            rootItemTree = new ItemTree( "root" );

            this.d3d = d3d;
            
            streamState = new VisualizerStreamState();
            textureVertexBuffer = new DynamicVertexBuffer( VertexPosition4fColor4f.SizeInBytes, 6 );
            var stream = textureVertexBuffer.MapForWriteDiscard();
            stream.Write( new Vector4f( 0, 0, 0, 1 ) );
            stream.Write( new Vector4f( 0, 1, 0, 1 ) );
            stream.Write( new Vector4f( 1, 0, 0, 1 ) );
            stream.Write( new Vector4f( 1, 1, 0, 1 ) );
            stream.Write( new Vector4f( 0, 1, 0, 1 ) );
            stream.Write( new Vector4f( 0, 0, 0, 1 ) );

            stream.Write( new Vector4f( 0, 1, 0, 1 ) );
            stream.Write( new Vector4f( 0, 0, 0, 1 ) );
            stream.Write( new Vector4f( 1, 0, 0, 1 ) );
            stream.Write( new Vector4f( 1, 1, 0, 1 ) );
            stream.Write( new Vector4f( 1, 1, 0, 1 ) );
            stream.Write( new Vector4f( 1, 0, 0, 1 ) );
            textureVertexBuffer.Unmap();

            effect = effectManager[ "visualizer.fx" ];

            opaquePass = effectManager[ "visualizer.fx", "renderOpaque", "p0" ];
            opaquePassLayout = new InputLayout( d3d.Device, opaquePass.Description.Signature, VertexPosition4fColor4f.InputElements );

            alphaPass = effectManager[ "visualizer.fx", "renderAlpha", "p0" ];
            alphaPassLayout = new InputLayout( d3d.Device, alphaPass.Description.Signature, VertexPosition4fColor4f.InputElements );

            additivePass = effectManager[ "visualizer.fx", "renderAdditive", "p0" ];
            additivePassLayout = new InputLayout( d3d.Device, additivePass.Description.Signature, VertexPosition4fColor4f.InputElements );
            
            opaqueTexturePass = effect.GetTechniqueByName( "renderTexOpaque" ).GetPassByName( "p0" );
            opaqueTexturePassLayout = new InputLayout( d3d.Device, opaqueTexturePass.Description.Signature, VertexPosition4fTexture4f.InputElements );

            alphaTexturePass = effect.GetTechniqueByName( "renderTexAlpha" ).GetPassByName( "p0" );
            alphaTexturePassLayout = new InputLayout( d3d.Device, alphaTexturePass.Description.Signature, VertexPosition4fTexture4f.InputElements );
        }
    public override void Init()
    {
        base.Init();

        m_EffectManager = new EffectManager();

        m_ColliderLayerMask = 1 << 8 | 1 << 10 | 1 << 11 | 1 << 31;

        LoadFSM();
        LoadEffect();

        m_FSMManager.LoadFSM(m_Entity.GetFSMPath());
        m_EffectManager.LoadEffect(m_Entity.GetEffectPath());

        m_EffectPerTime = m_Entity.GetEffectPerTime();
        m_TimeDelay = m_Entity.GetTimeDelay();
        m_TimeEffect = m_Entity.GetTimeEffect();
        m_EffectRadius = m_Entity.GetEffectRadius();

        m_AttachTransform = this.transform;
    }
Пример #23
0
    private void Start()
    {
        m_effect_names = new string[m_effects.Length];

        var idx = 0;
        foreach (var effect_data in m_effects)
        {
            m_effect_names[idx] = effect_data.m_name;

            // Set effect to loop infinitely
            if (effect_data.m_effect_sync.GetAnimation(0).NumLoops > 0)
                effect_data.m_effect_sync.GetAnimation(0).GetLoop(0).m_number_of_loops = 0;
            if (effect_data.m_effect_random.GetAnimation(0).NumLoops > 0)
                effect_data.m_effect_random.GetAnimation(0).GetLoop(0).m_number_of_loops = 0;

            idx ++;
        }

        m_current_active_effect = m_effects[0].m_effect_sync;
        m_current_active_effect.ResetAnimation();
        m_current_active_effect.transform.localPosition = m_local_position;
        m_current_active_effect.PlayAnimation(0.5f);
    }
Пример #24
0
        public override void Cast(Player player)
        {
            if (!HasMana(player) || IsOnCooldown())
            {
                return;
            }
            var friends = player.GetAlliesInRange(20f);

            friends.Add(player); // We want to heal self too

            foreach (var p in friends)
            {
                p.Heal(this.charges);
            }

            var effect = new EffectManager();

            effect.PersistantEffect("Effect_HealingCircle", player.gameObject, 2f, Vector3.zero);

            this.charges = 0;
            // Debug.Log(this.damage);
            player.energy     -= this.mana_cost;
            this.cooldown_time = 60 * 15;
        }
    void UpdateFunction()
    {
        m_time_delta = Time.realtimeSinceStartup - m_old_time;

        if (m_previewing_anim && !m_paused)
        {
            if (font_manager == null)
            {
                font_manager = (EffectManager)target;
            }

            if (m_time_delta > 0 && !font_manager.UpdateAnimation(m_time_delta) && font_manager.ParticleEffectManagers.Count == 0)
            {
                m_previewing_anim = false;
            }

            if (font_manager.ParticleEffectManagers.Count > 0)
            {
                SceneView.RepaintAll();
            }
        }

        if (m_set_text_delay > 0)
        {
            m_set_text_delay -= m_time_delta;

            if (m_set_text_delay <= 0)
            {
                m_set_text_delay = 0;

                font_manager.SetText(font_manager.m_text);
            }
        }

        m_old_time = Time.realtimeSinceStartup;
    }
Пример #26
0
        private void IL_SwingZapFistMeleeHit(ILContext il)
        {
            ILCursor c       = new ILCursor(il);
            bool     ilFound = c.TryGotoNext(
                x => x.MatchStfld <FireProjectileInfo>(nameof(FireProjectileInfo.projectilePrefab)));

            if (ilFound)
            {
                c.Emit(OpCodes.Ldarg_0);
                c.EmitDelegate <Func <GameObject, SwingZapFist, GameObject> >((origProj, state) => {
                    if (Scepter.instance.GetCount(state.outer.commonComponents.characterBody) < 1)
                    {
                        return(origProj);
                    }
                    var mTsf = state.outer.commonComponents.modelLocator?.modelTransform?.GetComponent <ChildLocator>()?.FindChild(state.swingEffectMuzzleString);
                    EffectManager.SpawnEffect(LegacyResourcesAPI.Load <GameObject>("prefabs/effects/ImpactEffects/LightningStrikeImpact"),
                                              new EffectData {
                        origin = mTsf?.position ?? state.outer.commonComponents.transform.position,
                        scale  = 1f
                    }, true);
                    return(projReplacer);
                });
            }
        }
 // Token: 0x06002D05 RID: 11525 RVA: 0x000BE0A8 File Offset: 0x000BC2A8
 private void FireVoidPortal()
 {
     if (base.cachedModelTransform)
     {
         EntityState.Destroy(base.cachedModelTransform.gameObject);
     }
     if (NetworkServer.active)
     {
         Collider[]      array  = Physics.OverlapSphere(this.muzzleTransform.position, DeathState.deathExplosionRadius, LayerIndex.entityPrecise.mask);
         CharacterBody[] array2 = new CharacterBody[array.Length];
         int             count  = 0;
         for (int i = 0; i < array.Length; i++)
         {
             CharacterBody characterBody = Util.HurtBoxColliderToBody(array[i]);
             if (characterBody && !(characterBody == base.characterBody) && Array.IndexOf <CharacterBody>(array2, characterBody, 0, count) == -1)
             {
                 array2[count++] = characterBody;
             }
         }
         foreach (CharacterBody characterBody2 in array2)
         {
             if (characterBody2 && characterBody2.healthComponent)
             {
                 characterBody2.healthComponent.Suicide(base.gameObject, base.gameObject, DamageType.VoidDeath);
             }
         }
         if (DeathState.deathExplosionEffect)
         {
             EffectManager.SpawnEffect(DeathState.deathExplosionEffect, new EffectData
             {
                 origin = base.characterBody.corePosition,
                 scale  = DeathState.deathExplosionRadius
             }, true);
         }
     }
 }
Пример #28
0
        public override void OnEnter()
        {
            base.OnEnter();
            this.duration = SpinningSlashOld.baseDuration / this.attackSpeedStat;
            this.hasFired = false;

            Util.PlayScaledSound(EntityStates.Merc.GroundLight.finisherAttackSoundString, base.gameObject, 0.5f);
            base.PlayAnimation("FullBody, Override", "SpinSlash", "Whirlwind.playbackRate", this.duration);

            EffectManager.SimpleMuzzleFlash(Modules.Assets.spinningSlashFX, base.gameObject, "SwingCenter", true);

            HitBoxGroup hitBoxGroup    = null;
            Transform   modelTransform = base.GetModelTransform();

            if (modelTransform)
            {
                hitBoxGroup = Array.Find <HitBoxGroup>(modelTransform.GetComponents <HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "SpinSlash");
            }

            this.attack                 = new OverlapAttack();
            this.attack.attacker        = base.gameObject;
            this.attack.inflictor       = base.gameObject;
            this.attack.teamIndex       = base.GetTeam();
            this.attack.damageType      = DamageType.Stun1s;
            this.attack.damage          = SpinSlashOld.chargeDamageCoefficient * this.damageStat;
            this.attack.hitEffectPrefab = Modules.Assets.hitFX;
            this.attack.forceVector     = Vector3.up * EntityStates.Toolbot.ToolbotDash.upwardForceMagnitude;
            this.attack.pushAwayForce   = EntityStates.Toolbot.ToolbotDash.awayForceMagnitude;
            this.attack.hitBoxGroup     = hitBoxGroup;
            this.attack.isCrit          = base.RollCrit();

            if (base.characterMotor)
            {
                base.SmallHop(base.characterMotor, 16f);
            }
        }
    public override void OnInspectorGUI()
    {
        EffectManager effectManager = (EffectManager)target;

        DrawDefaultInspector();

        EditorGUILayout.Space();
        if (GUILayout.Button("Load Effects"))
        {
            effectManager.LoadEffects();
        }

        EditorGUILayout.Space();
        if (GUILayout.Button("Sort All Effects"))
        {
            effectManager.SortAllLists();
        }

        EditorGUILayout.Space();
        if (GUILayout.Button("Save Effects"))
        {
            effectManager.SaveEffects();
        }
    }
Пример #30
0
        public override void Cast(Player p)
        {
            if (!HasMana(p) || IsOnCooldown())
            {
                return;
            }

            var enemy = p.GetEnemiesInRange(25f);

            foreach (var player in enemy)
            {
                Buff b = new Debuff_BlindingLight();
                b.Add(player);
            }

            var effect = new EffectManager();

            effect.PlayEffect("Effect_BlindingLight", p.transform.position);



            p.energy          -= this.mana_cost;
            this.cooldown_time = 60 * 15;
        }
Пример #31
0
    void OnUserEarnedReward_Revive()
    {
        // Success View Ads for Revive
        if (PlayerStatus.RemainReviveCount > 0)
        {
            Vibration.Vibrate(100);
            PlayerStatus.CurrentHP          = PlayerStatus.MaxHP;
            PlayerStatus.RemainReviveCount -= 1;

            TopMostControl.Instance().StartGlobalLightEffect(Color.yellow, 2f, 0.2f);
            TopMostControl.Instance().GameOver(false);

            if (cameraController != null)
            {
                cameraController.CameraShake_Rot(3);
            }

            EffectManager.GetInstance().playEffect(playerController.GetPlayerRigidBody().transform.position, EFFECT.YELLOW_PILLAR, Vector2.zero);
            TopMostControl.Instance().StartBGM(SceneManager.GetActiveScene());
            SoundManager.PlayOneShotSound(SoundContainer.Instance().SoundEffectsDic[GameStatics.sound_revive], SoundContainer.Instance().SoundEffectsDic[GameStatics.sound_revive].clip);

            Firebase.Analytics.FirebaseAnalytics.LogEvent(GameStatics.EVENT_REVIVE_ADS);
        }
    }
        protected override void LoadContent()
        {
            base.LoadContent();

            Art.Load(gameRef.Content);

            backgroundoverlay = new DrawableRectangle(GraphicsDevice, new Vector2(Game1.GAME_WIDTH, Game1.GAME_HEIGHT), Color.White, true).Texture;

            SpriteSheet explosionSs = new SpriteSheet(content.Load <Texture2D>("explosion"), 32, 32, gameRef.GraphicsDevice);

            Texture2D[] imgs = new Texture2D[] {
                explosionSs.GetSubImage(0, 0),
                explosionSs.GetSubImage(1, 0),
                explosionSs.GetSubImage(2, 0)
            };
            var explode = new Animation(imgs);

            EffectManager.Initialize(content.Load <Texture2D>("particle"), explode);

            if (singlePlayer)
            {
                backgroundImage = content.Load <Texture2D>("Screen Images\\apocalypselondon");
            }
        }
Пример #33
0
 private void Awake()
 {
     instance = this;
 }
Пример #34
0
 // Use this for initialization
 void Start()
 {
     //Singleton
     if (uniqueInstance == null)
         uniqueInstance = this;
     else
         Destroy(this.gameObject);
 }
Пример #35
0
 void Start()
 {
     inst = this;
 }
Пример #36
0
 // Use this for initialization
 void Awake()
 {
     I = this;
 }
        public void Awake()
        {
            On.RoR2.SceneDirector.PopulateScene += (orig, self) =>
            {
                orig(self);
                if (RoR2.SceneInfo.instance.sceneDef.stageOrder == 5)
                {
                    SpawnShrineOfDio(self);
                }
            };

            On.RoR2.ShrineHealingBehavior.FixedUpdate += (orig, self) =>
            {
                if (RoR2.SceneInfo.instance.sceneDef.stageOrder != 5)
                {
                    orig(self);
                    return;
                }
                orig(self);

                if (clientCost == UNINITIALIZED)
                {
                    int piCost = self.GetFieldValue <PurchaseInteraction>("purchaseInteraction").cost;
                    if (piCost != clientCost)
                    {
                        clientCost = piCost;
                        if (clientCost == BALANCED_MODE)
                        {
                            isBalancedMode = true;
                        }
                        else
                        {
                            isBalancedMode = false;
                        }
                        Type[] arr = ((IEnumerable <System.Type>) typeof(ChestRevealer).Assembly.GetTypes()).Where <System.Type>((Func <System.Type, bool>)(t => typeof(IInteractable).IsAssignableFrom(t))).ToArray <System.Type>();
                        for (int i = 0; i < arr.Length; i++)
                        {
                            foreach (UnityEngine.MonoBehaviour instances in InstanceTracker.FindInstancesEnumerable(arr[i]))
                            {
                                if (((IInteractable)instances).ShouldShowOnScanner())
                                {
                                    string item = ((IInteractable)instances).ToString().ToLower();
                                    if (item.Contains("shrinehealing"))
                                    {
                                        UpdateShrineDisplay(instances.GetComponentInParent <ShrineHealingBehavior>());
                                    }
                                }
                                ;
                            }
                        }
                    }
                }
            };

            On.RoR2.ShrineHealingBehavior.Awake += (orig, self) =>
            {
                if (RoR2.SceneInfo.instance.sceneDef.stageOrder != 5)
                {
                    orig(self);
                    return;
                }
                orig(self);

                PurchaseInteraction pi = self.GetFieldValue <PurchaseInteraction>("purchaseInteraction");
                pi.contextToken                = "Offer to the Shrine of empowered Dio";
                pi.displayNameToken            = "Shrine of empowered Dio";
                self.costMultiplierPerPurchase = 4f;



                pi.costType = CostTypeIndex.Money;
                //pi.cost = ResurrectionCost.Value * useCount;
                pi.cost = GetDifficultyScaledCost(ResurrectionCost);
            };

            On.RoR2.ShrineHealingBehavior.AddShrineStack += (orig, self, interactor) =>
            {
                if (RoR2.SceneInfo.instance.sceneDef.stageOrder != 5)
                {
                    orig(self, interactor);
                    return;
                }
                string resurrectionMessage = $"<color=#beeca1>{interactor.GetComponent<CharacterBody>().GetUserName()}</color> gained a <color=#beeca1>Dio</color>";
                Chat.SendBroadcastChat(new Chat.SimpleChatMessage
                {
                    baseToken = resurrectionMessage
                });
                self.SetFieldValue("waitingForRefresh", true);
                self.SetFieldValue("refreshTimer", 2f);
                EffectManager.SpawnEffect(Resources.Load <GameObject>("Prefabs/Effects/ShrineUseEffect"), new EffectData()
                {
                    origin   = self.transform.position,
                    rotation = Quaternion.identity,
                    scale    = 1f,
                    color    = (Color32)Color.red
                }, true);
                // dio
                CharacterBody cb = interactor.GetComponent <CharacterBody>();

                PurchaseInteraction pi = self.GetComponent <PurchaseInteraction>();
                PurchaseInteraction.CreateItemTakenOrb(cb.corePosition, pi.gameObject, RoR2.RoR2Content.Items.ExtraLife.itemIndex);
                cb.inventory.RemoveItem(RoR2.RoR2Content.Items.ExtraLifeConsumed.itemIndex, 1);
                cb.inventory.GiveItem(RoR2.RoR2Content.Items.ExtraLife.itemIndex, 1);
                useCount++;
            };

            On.RoR2.PurchaseInteraction.CanBeAffordedByInteractor += (orig, self, interactor) =>
            {
                if (self.displayNameToken.Contains("Shrine of empowered Dio"))
                {
                    if (interactor.GetComponent <CharacterBody>().inventory.GetItemCount(RoR2.RoR2Content.Items.ExtraLifeConsumed) > 0)
                    {
                        return(orig(self, interactor));
                    }
                    return(false);
                }
                return(orig(self, interactor));
            };
        }
Пример #38
0
        private void OnOnIngameUpdate(EventArgs args)
        {
            if (!MenuManager.IsEnable)
            {
                return;
            }

            Mode = OrbwalkingMode.Idle;

            var isTempest = BasicUnit as Tempest;

            if (isTempest != null && (Game.IsPaused || Game.IsChatOpen || !BasicUnit.IsAlive || !isTempest.IsValid))
            {
                return;
            }
            if (OrderManager.CurrentOrder == OrderManager.Orders.DefaultCombo ||
                (OrderManager.CurrentOrder == OrderManager.Orders.TempestCombo && (isTempest != null ||
                                                                                   !(BasicUnit is MainHero))))
            {
                if (BasicUnit.OrbwalkingBehaviour is CanUseOrbwalking)
                {
                    Mode = OrbwalkingMode.Combo;
                }
            }
            else if (OrderManager.CurrentOrder == OrderManager.Orders.AutoPushing)
            {
                Mode = OrbwalkingMode.Pushing;
                if (BasicUnit is MainHero)
                {
                    return;
                }
            }
            else if (Mode == OrbwalkingMode.Idle)
            {
                EffectManager.Remove("attackTarget" + Owner.Handle);
                return;
            }
            // turning
            if (TurnEndTime > Game.RawGameTime)
            {
                return;
            }
            var target = GetTarget();

            if ((target == null || !CanAttack(target) || UnitExtensions.IsAttackImmune(target)) && CanMove())
            {
                if (BasicUnit.OrbwalkingBehaviour is CanUseOrbwalking)
                {
                    BasicUnit.MoveAction(target);
                }
                return;
            }

            if (target != null && CanAttack(target))
            {
                LastTarget = target;
                Attack(target);
            }


            if (BasicUnit.OrbwalkingBehaviour is CanUseOrbwalking)
            {
                if (LastTarget != null && LastTarget.IsValid && LastTarget.IsAlive)
                {
                    EffectManager.DrawRange(LastTarget, "attackTarget" + Owner.Handle, 60, Color.Red);
                }
                else
                {
                    EffectManager.Remove("attackTarget" + Owner.Handle);
                }
            }
        }
Пример #39
0
 void Awake()
 {
     Instance = this;
 }
Пример #40
0
    public void SetMeshState(int action_idx, float action_progress, LetterAnimation animation, AnimatePerOptions animate_per, EffectManager effect_manager)
    {
        if (action_idx >= 0 && action_idx < animation.NumActions)
        {
            SetupMesh(animation.GetAction(action_idx), action_idx > 0 ? animation.GetAction(action_idx - 1) : null, Mathf.Clamp(action_progress, 0, 1), m_progression_variables, animate_per, Mathf.Clamp(action_progress, 0, 1), effect_manager);
        }
        else
        {
            // action not found for this letter. Position letter in its default position

            if (mesh_verts == null || mesh_verts.Length == 0)
            {
                mesh_verts = new Vector3[4];
            }

            for (int idx = 0; idx < 4; idx++)
            {
                mesh_verts[idx] = m_base_vertices[idx] + m_base_offset;
            }
            m_mesh.vertices = mesh_verts;
            m_mesh.colors   = new Color[] { Color.white, Color.white, Color.white, Color.white };
        }
    }
Пример #41
0
    // Animates the letter mesh and return the current action index in use
    public LETTER_ANIMATION_STATE AnimateMesh(bool force_render,
                                              float timer,
                                              TextAnchor text_anchor,
                                              int lowest_action_progress,
                                              LetterAnimation animation,
                                              AnimatePerOptions animate_per,
                                              float delta_time,
                                              EffectManager effect_manager)
    {
        m_last_animate_per      = animate_per;
        m_effect_manager_handle = effect_manager;

        if (animation.NumActions > 0 && m_anim_state_vars.m_action_index < animation.NumActions)
        {
            if (!m_anim_state_vars.m_active && !force_render)
            {
                return(LETTER_ANIMATION_STATE.STOPPED);
            }

            if (m_anim_state_vars.m_action_index != m_anim_state_vars.m_prev_action_index)
            {
                SetCurrentLetterAction(animation.GetAction(m_anim_state_vars.m_action_index), animate_per);

                m_anim_state_vars.m_started_action = false;
            }
            else if (m_current_letter_action == null)
            {
                SetCurrentLetterAction(animation.GetAction(m_anim_state_vars.m_action_index), animate_per);
            }

            m_anim_state_vars.m_prev_action_index = m_anim_state_vars.m_action_index;

            if (force_render)
            {
                SetupMesh(m_current_letter_action, m_anim_state_vars.m_action_index > 0 ? animation.GetAction(m_anim_state_vars.m_action_index - 1) : null, m_anim_state_vars.m_action_progress, m_progression_variables, animate_per, m_anim_state_vars.m_linear_progress, m_effect_manager_handle);
            }

            if (m_anim_state_vars.m_waiting_to_sync)
            {
                if (m_current_letter_action.m_action_type == ACTION_TYPE.BREAK)
                {
                    if (!force_render && m_anim_state_vars.m_break_delay > 0)
                    {
                        m_anim_state_vars.m_break_delay -= delta_time;

                        if (m_anim_state_vars.m_break_delay <= 0)
                        {
                            ContinueAction(timer, animation, animate_per);

                            return(LETTER_ANIMATION_STATE.PLAYING);
                        }
                    }

                    return(LETTER_ANIMATION_STATE.WAITING);
                }
                else if (lowest_action_progress < m_anim_state_vars.m_action_index_progress)
                {
                    return(LETTER_ANIMATION_STATE.PLAYING);
                }
                else if (!force_render)
                {
                    m_anim_state_vars.m_waiting_to_sync = false;

                    // reset timer offset to compensate for the sync-up wait time
                    m_anim_state_vars.m_timer_offset = timer;
                }
            }
            else if (!force_render && (m_current_letter_action.m_action_type == ACTION_TYPE.BREAK || (!m_anim_state_vars.m_reverse && m_current_letter_action.m_force_same_start_time && lowest_action_progress < m_anim_state_vars.m_action_index_progress)))
            {
                // Force letter to wait for rest of letters to be in sync
                m_anim_state_vars.m_waiting_to_sync = true;

                m_anim_state_vars.m_break_delay = Mathf.Max(m_current_letter_action.m_duration_progression.GetValue(m_progression_variables, animate_per), 0);

                return(LETTER_ANIMATION_STATE.PLAYING);
            }


            if (force_render)
            {
                return(m_anim_state_vars.m_active ? LETTER_ANIMATION_STATE.PLAYING : LETTER_ANIMATION_STATE.STOPPED);
            }

            m_anim_state_vars.m_action_progress = 0;
            m_anim_state_vars.m_linear_progress = 0;

            m_action_timer = timer - m_anim_state_vars.m_timer_offset;

            if ((m_anim_state_vars.m_reverse || m_action_timer > m_action_delay))
            {
                m_anim_state_vars.m_linear_progress = (m_action_timer - (m_anim_state_vars.m_reverse ? 0 : m_action_delay)) / m_action_duration;

                if (m_anim_state_vars.m_reverse)
                {
                    if (m_action_timer >= m_action_duration)
                    {
                        m_anim_state_vars.m_linear_progress = 0;
                    }
                    else
                    {
                        m_anim_state_vars.m_linear_progress = 1 - m_anim_state_vars.m_linear_progress;
                    }
                }


                if (!m_anim_state_vars.m_started_action)
                {
                    // Trigger any action onStart audio or particle effects

                    TriggerAudioEffect(animate_per, PLAY_ITEM_EVENTS.ON_START);

                    TriggerParticleEffects(animate_per, PLAY_ITEM_EVENTS.ON_START);

                    m_anim_state_vars.m_started_action = true;
                }


                m_anim_state_vars.m_action_progress = EasingManager.GetEaseProgress(m_current_letter_action.m_ease_type, m_anim_state_vars.m_linear_progress);

                if ((!m_anim_state_vars.m_reverse && m_anim_state_vars.m_linear_progress >= 1) || (m_anim_state_vars.m_reverse && m_action_timer >= m_action_duration + m_action_delay))
                {
                    m_anim_state_vars.m_action_progress = m_anim_state_vars.m_reverse ? 0 : 1;
                    m_anim_state_vars.m_linear_progress = m_anim_state_vars.m_reverse ? 0 : 1;

                    if (!m_anim_state_vars.m_reverse && m_anim_state_vars.m_action_index != -1)
                    {
                        TriggerParticleEffects(animate_per, PLAY_ITEM_EVENTS.ON_FINISH);

                        TriggerAudioEffect(animate_per, PLAY_ITEM_EVENTS.ON_FINISH);
                    }

                    int   prev_action_idx = m_anim_state_vars.m_action_index;
                    float prev_delay      = m_action_delay;

                    // Set next action index
                    SetNextActionIndex(animation);

                    if (m_anim_state_vars.m_active)
                    {
                        if (!m_anim_state_vars.m_reverse)
                        {
                            m_anim_state_vars.m_started_action = false;
                        }

                        if (!m_anim_state_vars.m_reverse && m_anim_state_vars.m_action_index_progress > m_anim_state_vars.m_action_index)
                        {
                            // Repeating the action again; check for unqiue random variable requests.
                            animation.GetAction(m_anim_state_vars.m_action_index).SoftReset(animation.GetAction(prev_action_idx), m_progression_variables, animate_per, m_anim_state_vars.m_action_index == 0);
                        }
                        else if (m_anim_state_vars.m_reverse)
                        {
                            animation.GetAction(m_anim_state_vars.m_action_index).SoftResetStarts(animation.GetAction(prev_action_idx), m_progression_variables, animate_per);
                        }

                        // Add to the timer offset
                        m_anim_state_vars.m_timer_offset += prev_delay + m_action_duration;

                        if (prev_action_idx != m_anim_state_vars.m_action_index)
                        {
                            UpdateLoopList(animation);
                        }
                        else
                        {
                            SetCurrentLetterAction(animation.GetAction(m_anim_state_vars.m_action_index), animate_per);
                        }
                    }
                }
            }

            SetupMesh(m_current_letter_action, m_anim_state_vars.m_action_index > 0 ? animation.GetAction(m_anim_state_vars.m_action_index - 1) : null, m_anim_state_vars.m_action_progress, m_progression_variables, animate_per, m_anim_state_vars.m_linear_progress, m_effect_manager_handle);
        }
        else
        {
            // no actions found for this letter. Position letter in its default position
            if (mesh_verts == null || mesh_verts.Length == 0)
            {
                mesh_verts = new Vector3[4];
            }

            for (int idx = 0; idx < 4; idx++)
            {
                mesh_verts[idx] = m_base_vertices[idx] + m_base_offset;
            }
            m_mesh.vertices = mesh_verts;

            m_anim_state_vars.m_active = false;
        }

        return(m_anim_state_vars.m_active ? LETTER_ANIMATION_STATE.PLAYING : LETTER_ANIMATION_STATE.STOPPED);
    }
Пример #42
0
    public LetterSetup(string character, int letter_idx, Mesh mesh, Vector3 base_offset, ref CustomCharacterInfo char_info, int line_num, int word_idx, EffectManager effect_manager)
    {
        m_character             = character;
        m_mesh                  = mesh;
        m_base_offset           = base_offset;
        m_effect_manager_handle = effect_manager;

        m_progression_variables = new AnimationProgressionVariables(letter_idx, word_idx, line_num);

        m_anim_state_vars = new AnimationStateVariables();
        m_anim_state_vars.m_active_loop_cycles = new List <ActionLoopCycle>();

        SetupLetterMesh(ref char_info);

        if (m_flipped)
        {
            // flip UV coords in x axis.
            m_mesh.uv = new Vector2[] { mesh.uv[3], mesh.uv[2], mesh.uv[1], mesh.uv[0] };
        }
    }
Пример #43
0
    public void Recycle(string character, int letter_idx, Mesh mesh, Vector3 base_offset, ref CustomCharacterInfo char_info, int line_num, int word_idx, EffectManager effect_manager)
    {
        m_character             = character;
        m_mesh                  = mesh;
        m_base_offset           = base_offset;
        m_effect_manager_handle = effect_manager;

        m_progression_variables = new AnimationProgressionVariables(letter_idx, word_idx, line_num);

        SetupLetterMesh(ref char_info);

        if (m_flipped)
        {
            // flip UV coords in x axis.
            m_mesh.uv = new Vector2[] { mesh.uv[3], mesh.uv[2], mesh.uv[1], mesh.uv[0] };
        }

        m_current_letter_action = null;
    }
Пример #44
0
 public void Create(EffectManager manager)
 {
     this.Manager = manager;
     this.Manager.LightSources.Add(this);
 }
 public void Initialize(InitParamFloatingMine initParam)
 {
     //IL_00be: Unknown result type (might be due to invalid IL or missing references)
     //IL_00c3: Expected O, but got Unknown
     //IL_0106: Unknown result type (might be due to invalid IL or missing references)
     //IL_010d: Unknown result type (might be due to invalid IL or missing references)
     //IL_0113: Unknown result type (might be due to invalid IL or missing references)
     //IL_0118: Unknown result type (might be due to invalid IL or missing references)
     //IL_011d: Unknown result type (might be due to invalid IL or missing references)
     //IL_012f: Unknown result type (might be due to invalid IL or missing references)
     //IL_0135: Unknown result type (might be due to invalid IL or missing references)
     //IL_013a: Unknown result type (might be due to invalid IL or missing references)
     //IL_014b: Unknown result type (might be due to invalid IL or missing references)
     //IL_015c: Unknown result type (might be due to invalid IL or missing references)
     //IL_0161: Expected O, but got Unknown
     //IL_016b: Unknown result type (might be due to invalid IL or missing references)
     //IL_0178: Unknown result type (might be due to invalid IL or missing references)
     //IL_017d: Unknown result type (might be due to invalid IL or missing references)
     //IL_0189: Unknown result type (might be due to invalid IL or missing references)
     //IL_0196: Unknown result type (might be due to invalid IL or missing references)
     //IL_019b: Expected O, but got Unknown
     //IL_01c1: Unknown result type (might be due to invalid IL or missing references)
     //IL_01c6: Unknown result type (might be due to invalid IL or missing references)
     //IL_01fa: Unknown result type (might be due to invalid IL or missing references)
     //IL_01ff: Expected O, but got Unknown
     //IL_021e: Unknown result type (might be due to invalid IL or missing references)
     //IL_0220: Unknown result type (might be due to invalid IL or missing references)
     if (initParam.atkInfo != null)
     {
         m_atkInfo = initParam.atkInfo;
         AttackHitInfo attackHitInfo = m_atkInfo as AttackHitInfo;
         if (attackHitInfo != null)
         {
             attackHitInfo.enableIdentityCheck = false;
         }
         BulletData bulletData = m_atkInfo.bulletData;
         if (!(bulletData == null))
         {
             BulletData.BulletBase data = bulletData.data;
             if (data != null)
             {
                 BulletData.BulletMine dataMine = bulletData.dataMine;
                 if (dataMine != null)
                 {
                     m_attacker          = initParam.attacker;
                     m_landHitEffectName = data.landHiteffectName;
                     m_aliveTimer        = data.appearTime;
                     m_moveSpeed         = data.speed;
                     m_slowDownRate      = dataMine.slowDownRate;
                     m_unbreakableTimer  = dataMine.unbrakableTime;
                     m_mineData          = dataMine;
                     m_isDeleted         = false;
                     m_cachedTransform   = this.get_transform();
                     m_cachedTransform.set_parent((!MonoBehaviourSingleton <StageObjectManager> .IsValid()) ? MonoBehaviourSingleton <EffectManager> .I._transform : MonoBehaviourSingleton <StageObjectManager> .I._transform);
                     Transform launchTrans = initParam.launchTrans;
                     m_cachedTransform.set_position(launchTrans.get_position() + launchTrans.get_rotation() * initParam.offsetPos);
                     m_cachedTransform.set_rotation(launchTrans.get_rotation() * initParam.offsetRot);
                     m_cachedTransform.set_localScale(data.timeStartScale);
                     Transform effect = EffectManager.GetEffect(data.effectName, this.get_transform());
                     effect.set_localPosition(data.dispOffset);
                     effect.set_localRotation(Quaternion.Euler(data.dispRotation));
                     effect.set_localScale(Vector3.get_one());
                     m_effectObj            = effect.get_gameObject();
                     m_effectDeleteAnimator = m_effectObj.GetComponent <Animator>();
                     float   radius    = data.radius;
                     float   height    = 0f;
                     Vector3 hitOffset = data.hitOffset;
                     int     num       = 0;
                     if (dataMine.isIgnoreHitEnemyAttack)
                     {
                         num |= 0xA000;
                     }
                     if (dataMine.isIgnoreHitEnemyMove)
                     {
                         num |= 0x400;
                     }
                     GameObject       val = new GameObject("MineAttackObject");
                     MineAttackObject mineAttackObject = val.AddComponent <MineAttackObject>();
                     mineAttackObject.Initialize(m_attacker, m_cachedTransform, m_atkInfo, hitOffset, Vector3.get_zero(), radius, height, 31);
                     mineAttackObject.SetIgnoreLayerMask(num);
                     m_mineAttackObj = mineAttackObject;
                     RequestMain();
                 }
             }
         }
     }
 }
Пример #46
0
        public virtual void Initialize()
        {
            effectManager = new EffectManager(GraphicsDevice, Content);
            backBufferManager = new BackBufferManager(GraphicsDevice);

            LoadContent();
        }
    private IEnumerator DoStartLogoAnimation(bool tutorial_flag, Action onComplete, Action onLoop)
    {
        logo.root.set_position(Vector3.get_up() * 1000f);
        logo.root.set_rotation(Quaternion.get_identity());
        logo.root.set_localScale(Vector3.get_one());
        logo.camera.get_gameObject().SetActive(true);
        Material faderMat = logo.fader.get_material();
        Material logoMat  = logo.logo.get_material();

        logo.camera.set_depth(-1f);
        logo.dragonRoot.SetActive(false);
        Color dragonPlaneColor = new Color(1f, 1f, 1f, 0f);

        logo.dragonPlane.get_sharedMaterial().SetColor("Color", dragonPlaneColor);
        if (tutorial_flag)
        {
            this.StartCoroutine(DoFadeOut());
            SoundManager.RequestBGM(11, false);
            while (MonoBehaviourSingleton <SoundManager> .I.playingBGMID != 11 || MonoBehaviourSingleton <SoundManager> .I.changingBGM)
            {
                yield return((object)null);
            }
            yield return((object)new WaitForSeconds(2.3f));
        }
        else
        {
            faderMat.SetColor("_Color", new Color(0f, 0f, 0f, 0f));
        }
        effects = (GameObject[])new GameObject[titleEffectPrefab.Length];
        for (int j = 0; j < titleEffectPrefab.Length; j++)
        {
            rymFX effect = ResourceUtility.Realizes(titleEffectPrefab[j], -1).GetComponent <rymFX>();
            effect.Cameras = (Camera[])new Camera[1]
            {
                logo.camera
            };
            effect.get__transform().set_localScale(effect.get__transform().get_localScale() * 10f);
            if (j == 1)
            {
                effect.get__transform().set_position(new Vector3(0.568f, 999.946f, 0.1f));
            }
            else
            {
                effect.get__transform().set_position(logo.eye.get_transform().get_position());
            }
            effects[j] = effect.get_gameObject();
        }
        yield return((object)new WaitForSeconds(1f));

        float timer4 = 0f;

        while (timer4 < 0.17f)
        {
            timer4 += Time.get_deltaTime();
            float s = Mathf.Clamp01(timer4 / 0.17f);
            logo.eye.get_transform().set_localScale(Vector3.get_one() * s * 10f);
            logoMat.SetFloat("_AlphaRate", -1f + timer4 * 2f);
            yield return((object)null);
        }
        logo.dragonRoot.SetActive(true);
        while (timer4 < 1f)
        {
            timer4 += Time.get_deltaTime();
            logoMat.SetFloat("_AlphaRate", -1f + timer4 * 2f);
            dragonPlaneColor.a = timer4;
            logo.dragonPlane.get_sharedMaterial().SetColor("Color", dragonPlaneColor);
            yield return((object)null);
        }
        dragonPlaneColor.a = 1f;
        logo.dragonPlane.get_sharedMaterial().SetColor("Color", dragonPlaneColor);
        timer4 = 0f;
        while (timer4 < 0.5f)
        {
            timer4 += Time.get_deltaTime();
            logoMat.SetFloat("_BlendRate", timer4 * 2f);
            yield return((object)null);
        }
        logo.bg.SetActive(true);
        logo.effect1.SetActive(true);
        timer4 = 0f;
        Material bgMaterial = logo.bgFader.get_material();

        while (timer4 < 0.7f)
        {
            timer4 += Time.get_deltaTime();
            bgMaterial.set_color(new Color(1f, 1f, 1f, 1f - timer4 / 0.7f));
            yield return((object)null);
        }
        if (!tutorial_flag)
        {
            onLoop?.Invoke();
            while (!tutorial_flag)
            {
                yield return((object)null);
            }
        }
        yield return((object)new WaitForSeconds(0.3f));

        if (titleUIPrefab != null)
        {
            Transform title_ui = ResourceUtility.Realizes(titleUIPrefab, MonoBehaviourSingleton <UIManager> .I.uiRootTransform, 5);
            if (title_ui != null)
            {
                Transform t3 = Utility.Find(title_ui, "BTN_START");
                if (t3 != null)
                {
                    t3.GetComponent <Collider>().set_enabled(false);
                }
                t3 = Utility.Find(title_ui, "BTN_ADVANCED_LOGIN");
                if (t3 != null)
                {
                    t3.get_gameObject().SetActive(false);
                }
                t3 = Utility.Find(title_ui, "BTN_CLEARCACHE");
                if (t3 != null)
                {
                    t3.get_gameObject().SetActive(false);
                }
            }
        }
        yield return((object)new WaitForSeconds(6f));

        timer4 = 0f;
        while (timer4 < 0.3f)
        {
            timer4 += Time.get_deltaTime();
            faderMat.SetColor("_Color", new Color(0f, 0f, 0f, timer4 / 0.3f));
            yield return((object)null);
        }
        MonoBehaviourSingleton <InputManager> .I.SetDisable(INPUT_DISABLE_FACTOR.INGAME_TUTORIAL, false);

        for (int i = 0; i < effects.Length; i++)
        {
            EffectManager.ReleaseEffect(effects[i], true, false);
        }
        onComplete?.Invoke();
    }
Пример #48
0
    void SetupMesh(LetterAction letter_action, LetterAction prev_action, float action_progress, AnimationProgressionVariables progression_variables, AnimatePerOptions animate_per, float linear_progress, EffectManager effect_manager)
    {
        // construct current anchor offset vector
        m_anchor_offset = letter_action.AnchorOffsetStart;
        m_anchor_offset = new Vector3(m_anchor_offset.x * m_width,
                                      letter_action.m_letter_anchor_start == (int)TextfxTextAnchor.BaselineLeft || letter_action.m_letter_anchor_start == (int)TextfxTextAnchor.BaselineCenter || letter_action.m_letter_anchor_start == (int)TextfxTextAnchor.BaselineRight
                                                                                        ? 0             // zero because letters are based around the baseline already.
                                                                                        : (effect_manager.IsFontBaseLineSet
                                                                                                        ? (effect_manager.FontBaseLine + m_y_offset) - (m_anchor_offset.y * -m_height)
                                                                                                        : (m_anchor_offset.y * m_height)),      // Legacy effect support when baseline isn't already set.
                                      0);

        if (letter_action.m_letter_anchor_2_way)
        {
            m_anchor_offset = letter_action.AnchorOffsetEnd;
            m_anchor_offset = Vector3.Lerp(m_anchor_offset,
                                           new Vector3(
                                               m_anchor_offset.x * m_width,
                                               letter_action.m_letter_anchor_end == (int)TextfxTextAnchor.BaselineLeft || letter_action.m_letter_anchor_end == (int)TextfxTextAnchor.BaselineCenter || letter_action.m_letter_anchor_end == (int)TextfxTextAnchor.BaselineRight
                                                                                                        ? 0             // zero because letters are based around the baseline already.
                                                                                                        : (effect_manager.IsFontBaseLineSet
                                                                                                                        ? (effect_manager.FontBaseLine + m_y_offset) - (m_anchor_offset.y * -m_height)
                                                                                                                        : (m_anchor_offset.y * m_height)),      // Legacy effect support when baseline isn't already set.
                                               0),
                                           action_progress);
        }


        // Calculate Scale Vector
        from_vec = letter_action.m_start_scale.GetValue(progression_variables, animate_per);
        to_vec   = letter_action.m_end_scale.GetValue(progression_variables, animate_per);

        if (letter_action.m_scale_axis_ease_data.m_override_default)
        {
            m_letter_scale = new Vector3(EffectManager.FloatLerp(from_vec.x, to_vec.x, EasingManager.GetEaseProgress(letter_action.m_scale_axis_ease_data.m_x_ease, linear_progress)),
                                         EffectManager.FloatLerp(from_vec.y, to_vec.y, EasingManager.GetEaseProgress(letter_action.m_scale_axis_ease_data.m_y_ease, linear_progress)),
                                         EffectManager.FloatLerp(from_vec.z, to_vec.z, EasingManager.GetEaseProgress(letter_action.m_scale_axis_ease_data.m_z_ease, linear_progress)));
        }
        else
        {
            m_letter_scale = EffectManager.Vector3Lerp(
                from_vec,
                to_vec,
                action_progress);
        }

        // Calculate Rotation
        from_vec = letter_action.m_start_euler_rotation.GetValue(progression_variables, animate_per);
        to_vec   = letter_action.m_end_euler_rotation.GetValue(progression_variables, animate_per);

        if (letter_action.m_rotation_axis_ease_data.m_override_default)
        {
            m_letter_rotation = Quaternion.Euler
                                (
                EffectManager.FloatLerp(from_vec.x, to_vec.x, EasingManager.GetEaseProgress(letter_action.m_rotation_axis_ease_data.m_x_ease, linear_progress)),
                EffectManager.FloatLerp(from_vec.y, to_vec.y, EasingManager.GetEaseProgress(letter_action.m_rotation_axis_ease_data.m_y_ease, linear_progress)),
                EffectManager.FloatLerp(from_vec.z, to_vec.z, EasingManager.GetEaseProgress(letter_action.m_rotation_axis_ease_data.m_z_ease, linear_progress))
                                );
        }
        else
        {
            m_letter_rotation = Quaternion.Euler(
                EffectManager.Vector3Lerp(
                    from_vec,
                    to_vec,
                    action_progress)
                );
        }


        // Calculate Position
        if (letter_action.m_start_pos.Progression == ActionPositionVector3Progression.CURVE_OPTION_INDEX || (letter_action.m_offset_from_last && prev_action != null && prev_action.m_end_pos.Progression == ActionPositionVector3Progression.CURVE_OPTION_INDEX))
        {
            from_vec = new Vector3(-m_anchor_offset.x, m_base_offset.y, 0);
        }
        else if (letter_action.m_start_pos.m_force_position_override)
        {
            from_vec = new Vector3(-m_anchor_offset.x, 0, 0);
        }
        else
        {
            from_vec = BaseOffset;
        }

        from_vec += letter_action.m_start_pos.GetValue(progression_variables, animate_per);

        if (letter_action.m_end_pos.Progression == ActionPositionVector3Progression.CURVE_OPTION_INDEX || (letter_action.m_end_pos.IsOffsetFromLast && letter_action.m_start_pos.Progression == ActionPositionVector3Progression.CURVE_OPTION_INDEX))
        {
            to_vec = new Vector3(-m_anchor_offset.x, m_base_offset.y, 0);
        }
        else if (letter_action.m_end_pos.m_force_position_override)
        {
            to_vec = new Vector3(-m_anchor_offset.x, 0, 0);
        }
        else
        {
            to_vec = BaseOffset;
        }

        to_vec += letter_action.m_end_pos.GetValue(progression_variables, animate_per);

        if (letter_action.m_position_axis_ease_data.m_override_default)
        {
            m_letter_position = new Vector3(EffectManager.FloatLerp(from_vec.x, to_vec.x, EasingManager.GetEaseProgress(letter_action.m_position_axis_ease_data.m_x_ease, linear_progress)),
                                            EffectManager.FloatLerp(from_vec.y, to_vec.y, EasingManager.GetEaseProgress(letter_action.m_position_axis_ease_data.m_y_ease, linear_progress)),
                                            EffectManager.FloatLerp(from_vec.z, to_vec.z, EasingManager.GetEaseProgress(letter_action.m_position_axis_ease_data.m_z_ease, linear_progress)));
        }
        else
        {
            m_letter_position = EffectManager.Vector3Lerp(
                from_vec,
                to_vec,
                action_progress);
        }

        // Calculate letter center position
        m_letter_center  = new Vector3(m_width / 2, m_height / 2, 0);
        m_letter_center -= m_anchor_offset;
        m_letter_center  = Vector3.Scale(m_letter_center, m_letter_scale);
        m_letter_center  = m_letter_rotation * m_letter_center;
        m_letter_center += m_anchor_offset + m_letter_position;


        if (mesh_verts == null || mesh_verts.Length == 0)
        {
            mesh_verts = new Vector3[4];
        }
        for (int idx = 0; idx < 4; idx++)
        {
            mesh_verts[idx] = m_base_vertices[idx];

            // normalise vert position to the anchor point before scaling and rotating.
            mesh_verts[idx] -= m_anchor_offset;

            // Scale verts
            mesh_verts[idx] = Vector3.Scale(mesh_verts[idx], m_letter_scale);

            // Rotate vert
            mesh_verts[idx] = m_letter_rotation * mesh_verts[idx];

            mesh_verts[idx] += m_anchor_offset;

            // translate vert
            mesh_verts[idx] += m_letter_position;
        }
        m_mesh.vertices = mesh_verts;



        // Sort out letters colour
        if (letter_action.m_use_gradient_start)
        {
            start_colour = letter_action.m_start_vertex_colour.GetValue(progression_variables, animate_per);
        }
        else
        {
            start_colour = new VertexColour(letter_action.m_start_colour.GetValue(progression_variables, animate_per));
        }

        if (letter_action.m_use_gradient_end)
        {
            end_colour = letter_action.m_end_vertex_colour.GetValue(progression_variables, animate_per);
        }
        else
        {
            end_colour = new VertexColour(letter_action.m_end_colour.GetValue(progression_variables, animate_per));
        }

        if (!m_flipped)
        {
            m_mesh.colors = new Color[] {
                Color.Lerp(start_colour.top_right, end_colour.top_right, action_progress),
                Color.Lerp(start_colour.top_left, end_colour.top_left, action_progress),
                Color.Lerp(start_colour.bottom_left, end_colour.bottom_left, action_progress),
                Color.Lerp(start_colour.bottom_right, end_colour.bottom_right, action_progress)
            };
        }
        else
        {
            m_mesh.colors = new Color[] {
                Color.Lerp(start_colour.top_left, end_colour.top_left, action_progress),
                Color.Lerp(start_colour.bottom_left, end_colour.bottom_left, action_progress),
                Color.Lerp(start_colour.bottom_right, end_colour.bottom_right, action_progress),
                Color.Lerp(start_colour.top_right, end_colour.top_right, action_progress)
            };
        }
    }
Пример #49
0
 private void Awake()
 {
     sight         = transform.Find("Sight").GetComponent <Sight>();
     attackRange   = transform.Find("AttackRange").GetComponent <AttackRange>();
     effectManager = GetComponentInChildren <EffectManager>();
 }
Пример #50
0
    public void AddEffect(bool isStay = false)
    {
        if (!m_PackageBoxAttr.HasValue || m_DropItemState == DropItemState.None)
        {
            return;
        }

        if (m_DropItemState == DropItemState.Born)
        {
            EffectController bornFxInstance = EffectManager.GetInstance().CreateEffect(m_PackageBoxAttr.Value.RefreshGfx, EffectManager.GetEffectGroupNameInSpace(false));
            bornFxInstance.transform.position = gameObject.transform.position;
            WwiseUtil.PlaySound((int)WwiseMusic.DropItem_Bron, false, bornFxInstance.transform.position);
            bornFxInstance.SetCreateForMainPlayer(false);

            m_StayFxInstance = EffectManager.GetInstance().CreateEffect(m_PackageBoxAttr.Value.ContinuousGfx, EffectManager.GetEffectGroupNameInSpace(false));
            m_StayFxInstance.transform.SetParent(gameObject.transform, false);
            m_StayFxInstance.SetCreateForMainPlayer(false);
        }
        else if (m_DropItemState == DropItemState.Stay && isStay)
        {
            m_StayFxInstance = EffectManager.GetInstance().CreateEffect(m_PackageBoxAttr.Value.ContinuousGfx, EffectManager.GetEffectGroupNameInSpace(false));
            m_StayFxInstance.transform.SetParent(gameObject.transform, false);
            m_StayFxInstance.SetCreateForMainPlayer(false);
        }
        else if (m_DropItemState == DropItemState.Gather)
        {
            RemoveStayFx();

            m_GatherFxInstance = EffectManager.GetInstance().CreateEffect(m_PackageBoxAttr.Value.PickUpGfx, EffectManager.GetEffectGroupNameInSpace(false));
            m_GatherFxInstance.transform.position = gameObject.transform.position;
            m_GatherFxInstance.SetCreateForMainPlayer(false);
        }
    }
    private void LateUpdate()
    {
        //IL_0012: Unknown result type (might be due to invalid IL or missing references)
        //IL_006d: Unknown result type (might be due to invalid IL or missing references)
        //IL_0073: Unknown result type (might be due to invalid IL or missing references)
        //IL_0084: Unknown result type (might be due to invalid IL or missing references)
        //IL_0089: Unknown result type (might be due to invalid IL or missing references)
        //IL_0099: Unknown result type (might be due to invalid IL or missing references)
        //IL_009e: Unknown result type (might be due to invalid IL or missing references)
        //IL_00b9: Unknown result type (might be due to invalid IL or missing references)
        //IL_00e2: Unknown result type (might be due to invalid IL or missing references)
        //IL_00e7: Unknown result type (might be due to invalid IL or missing references)
        //IL_013d: Unknown result type (might be due to invalid IL or missing references)
        //IL_0142: Unknown result type (might be due to invalid IL or missing references)
        //IL_0183: Unknown result type (might be due to invalid IL or missing references)
        //IL_018a: Expected O, but got Unknown
        //IL_0190: Unknown result type (might be due to invalid IL or missing references)
        //IL_01cd: Unknown result type (might be due to invalid IL or missing references)
        //IL_01d2: Unknown result type (might be due to invalid IL or missing references)
        //IL_01d6: Unknown result type (might be due to invalid IL or missing references)
        //IL_01db: Unknown result type (might be due to invalid IL or missing references)
        //IL_01e2: Unknown result type (might be due to invalid IL or missing references)
        //IL_01e7: Unknown result type (might be due to invalid IL or missing references)
        //IL_01e8: Unknown result type (might be due to invalid IL or missing references)
        //IL_01ed: Unknown result type (might be due to invalid IL or missing references)
        //IL_020e: Unknown result type (might be due to invalid IL or missing references)
        //IL_0219: Unknown result type (might be due to invalid IL or missing references)
        //IL_022f: Unknown result type (might be due to invalid IL or missing references)
        //IL_0234: Unknown result type (might be due to invalid IL or missing references)
        //IL_0247: Unknown result type (might be due to invalid IL or missing references)
        //IL_024c: Unknown result type (might be due to invalid IL or missing references)
        //IL_0251: Unknown result type (might be due to invalid IL or missing references)
        //IL_0252: Unknown result type (might be due to invalid IL or missing references)
        //IL_0257: Unknown result type (might be due to invalid IL or missing references)
        //IL_0259: Unknown result type (might be due to invalid IL or missing references)
        //IL_025a: Unknown result type (might be due to invalid IL or missing references)
        //IL_025c: Unknown result type (might be due to invalid IL or missing references)
        //IL_0261: Unknown result type (might be due to invalid IL or missing references)
        //IL_0269: Unknown result type (might be due to invalid IL or missing references)
        //IL_0270: Unknown result type (might be due to invalid IL or missing references)
        //IL_0280: Unknown result type (might be due to invalid IL or missing references)
        //IL_0285: Unknown result type (might be due to invalid IL or missing references)
        //IL_029d: Unknown result type (might be due to invalid IL or missing references)
        //IL_02be: Unknown result type (might be due to invalid IL or missing references)
        //IL_02ef: Unknown result type (might be due to invalid IL or missing references)
        if (targetObject == null)
        {
            this.get_gameObject().SetActive(false);
        }
        else
        {
            if (animEventProcessor != null)
            {
                animEventProcessor.Update();
            }
            switch (animationStep)
            {
            case AnimationStep.MOVE_TO_TARGET_POS:
            {
                animationTimer += Time.get_deltaTime();
                Vector3 position2 = Vector3.Lerp(dropPos, targetPos, animationTimer / MOVE_TO_TARGET_TIME);
                float   x         = position2.x;
                Vector3 position3 = _transform.get_position();
                position2._002Ector(x, position3.y, position2.z);
                _transform.set_position(position2);
                if (animationTimer >= MOVE_TO_TARGET_TIME)
                {
                    animationStep = AnimationStep.DROP_TO_GROUND;
                }
                break;
            }

            case AnimationStep.DROP_TO_GROUND:
            {
                AnimatorStateInfo currentAnimatorStateInfo2 = animator.GetCurrentAnimatorStateInfo(0);
                if (currentAnimatorStateInfo2.get_fullPathHash() == endAnimHash)
                {
                    targetPoint   = this.GetComponent <TargetPoint>();
                    animationStep = AnimationStep.NONE;
                }
                if (isRare)
                {
                    SoundManager.PlayOneShotUISE(10000061);
                }
                else
                {
                    SoundManager.PlayOneShotUISE(10000062);
                }
                break;
            }

            case AnimationStep.OPEN:
            {
                AnimatorStateInfo currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(0);
                if (currentAnimatorStateInfo.get_fullPathHash() == openAnimHash && currentAnimatorStateInfo.get_normalizedTime() > 0.99f)
                {
                    animationStep = AnimationStep.NONE;
                    if (effect != null)
                    {
                        EffectManager.ReleaseEffect(effect.get_gameObject(), true, false);
                    }
                    this.get_gameObject().SetActive(false);
                }
                break;
            }

            case AnimationStep.GET:
                if (distanceAnim.IsPlaying())
                {
                    moveTime += Time.get_deltaTime();
                    Bounds  bounds    = targetObject._collider.get_bounds();
                    Vector3 center    = bounds.get_center();
                    Vector3 val       = _transform.get_position() - center;
                    float   magnitude = val.get_magnitude();
                    if (distance < magnitude)
                    {
                        distance = magnitude;
                    }
                    val = val.get_normalized() * distance * (1f - distanceAnim.Update());
                    Vector3 val2     = Quaternion.AngleAxis(moveTime * speedAnim.Update(), Vector3.get_up()) * val;
                    Vector3 position = center + val2;
                    _transform.set_position(position);
                    Vector3 localScale = Vector3.get_one() * scaleAnim.Update();
                    if (distanceAnim.IsPlaying())
                    {
                        _transform.set_localScale(localScale);
                    }
                }
                else
                {
                    Transform val3 = EffectManager.GetEffect("ef_btl_mpdrop_01", null);
                    val3.set_position(_transform.get_position());
                    rymFX component = val3.GetComponent <rymFX>();
                    if (component != null)
                    {
                        component.AutoDelete = true;
                        component.LoopEnd    = true;
                    }
                    this.get_gameObject().SetActive(false);
                }
                break;
            }
        }
    }
Пример #52
0
 void Awake()
 {
     if (Inst == null)
         Inst = this;
 }
Пример #53
0
 public void Shutdown()
 {
     Destroy(gameObject);
     instance = null;
 }
Пример #54
0
 private void Awake()
 {
     effectManager = GameObject.Find("GameManager").GetComponent <EffectManager>();
 }
Пример #55
0
    private void DrawGUIWindow(out int edited_action, out bool start_of_action)
    {
        // Set out parameters to a default value
        start_of_action = true;
        edited_action = -1;

        // Check whether a EffectManager object is selected
        if (Selection.gameObjects.Length == 1)
            font_manager = Selection.gameObjects[0].GetComponent<EffectManager>();

        if (font_manager == null)
            return;

        DrawEffectEditorPanel();

        if (!ignore_gui_change)
        {
            start_of_action = editing_start_state;
            edited_action = edited_action_idx;
        }
    }
Пример #56
0
        public override void FixedUpdate()
        {
            base.FixedUpdate();

            if ((base.fixedAge - this.prevShot) > this.duration)
            {
                if (bulletCount > 0)
                {
                    this.prevShot = base.fixedAge;
                    bulletCount--;
                    base.AddRecoil(-3f * this.recoil, -4f * this.recoil, -0.5f * this.recoil, 0.5f * this.recoil);
                    Ray aimRay = base.GetAimRay();
                    muzzleName = "MuzzlePistol";
                    Util.PlaySound(FireBarrageScepter.attackSoundString, base.gameObject);
                    if (BanditReloaded.BanditReloaded.useOldModel)
                    {
                        base.PlayAnimation("Gesture, Additive", "FireRevolver");
                        base.PlayAnimation("Gesture, Override", "FireRevolver");
                    }
                    else
                    {
                        base.PlayAnimation("Gesture, Additive", "FireSideWeapon", "FireSideWeapon.playbackRate", 0.5f);
                    }
                    if (FireBarrageScepter.effectPrefab)
                    {
                        EffectManager.SimpleMuzzleFlash(FireBarrageScepter.effectPrefab, base.gameObject, muzzleName, false);
                    }
                    float bulletSpread = bulletCount <= 0 ? 0f : FireBarrageScepter.spread;
                    if (base.isAuthority)
                    {
                        new BulletAttack
                        {
                            owner              = base.gameObject,
                            weapon             = base.gameObject,
                            origin             = aimRay.origin,
                            aimVector          = aimRay.direction,
                            minSpread          = bulletSpread,
                            maxSpread          = bulletSpread,
                            force              = FireBarrageScepter.force,
                            falloffModel       = BulletAttack.FalloffModel.None,
                            tracerEffectPrefab = FireBarrageScepter.tracerEffectPrefab,
                            muzzleName         = muzzleName,
                            hitEffectPrefab    = FireBarrageScepter.hitEffectPrefab,
                            isCrit             = this.isCrit,
                            HitEffectNormal    = true,
                            radius             = 0.4f,
                            maxDistance        = FireBarrageScepter.maxDistance,
                            procCoefficient    = 1f,
                            damage             = FireBarrageScepter.damageCoefficient * this.damageStat,
                            damageType         = DamageType.ResetCooldownsOnKill | DamageType.SlowOnHit,
                            smartCollision     = true
                        }.Fire();
                        base.characterBody.SetSpreadBloom(FireBarrage.spread * 0.8f, false);
                    }
                }
                else if (base.fixedAge - prevShot > endLag)
                {
                    if (this.animator)
                    {
                        this.animator.SetLayerWeight(this.bodySideWeaponLayerIndex, 0f);
                    }
                    Transform transform = base.FindModelChild("SpinningPistolFX");
                    if (transform)
                    {
                        transform.gameObject.SetActive(false);
                    }
                    earlyExit = false;
                    this.outer.SetNextState(new ExitRevolver());
                    return;
                }
            }
        }
Пример #57
0
        public override void OnEnter()
        {
            base.OnEnter();
            Ray aimRay = base.GetAimRay();

            this.duration = this.baseDuration;

            Util.PlaySound(DiggerPlugin.Sounds.Backblast, base.gameObject);
            base.StartAimMode(0.6f, true);

            base.characterMotor.disableAirControlUntilCollision = false;

            float angle = Vector3.Angle(new Vector3(0, -1, 0), aimRay.direction);

            if (angle < 60)
            {
                base.PlayAnimation("FullBody, Override", "BackblastUp");
            }
            else if (angle > 120)
            {
                base.PlayAnimation("FullBody, Override", "BackblastDown");
            }
            else
            {
                base.PlayAnimation("FullBody, Override", "Backblast");
            }

            if (NetworkServer.active)
            {
                base.characterBody.AddBuff(RoR2Content.Buffs.HiddenInvincibility);
            }

            if (base.isAuthority)
            {
                Vector3 theSpot = aimRay.origin + 2 * aimRay.direction;

                BlastAttack blastAttack = new BlastAttack();
                blastAttack.radius            = 14f;
                blastAttack.procCoefficient   = 1f;
                blastAttack.position          = theSpot;
                blastAttack.attacker          = base.gameObject;
                blastAttack.crit              = Util.CheckRoll(base.characterBody.crit, base.characterBody.master);
                blastAttack.baseDamage        = base.characterBody.damage * BackBlast.damageCoefficient;
                blastAttack.falloffModel      = BlastAttack.FalloffModel.None;
                blastAttack.baseForce         = 500f;
                blastAttack.teamIndex         = TeamComponent.GetObjectTeam(blastAttack.attacker);
                blastAttack.damageType        = DamageType.Stun1s;
                blastAttack.attackerFiltering = AttackerFiltering.NeverHit;
                BlastAttack.Result result = blastAttack.Fire();

                EffectData effectData = new EffectData();
                effectData.origin = theSpot;
                effectData.scale  = 15;

                EffectManager.SpawnEffect(DiggerPlugin.DiggerPlugin.backblastEffect, effectData, false);

                base.characterMotor.velocity = -80 * aimRay.direction;

                Compacted?.Invoke(result.hitCount);
            }
        }
Пример #58
0
 void Awake()
 {
     Instance = this;
 }
Пример #59
0
        public static IEnumerator SendAirstrike(UnturnedPlayer uCaller, Vector3 Position)
        {
            Vector3        callerPosition = new Vector3();
            List <Vector3> StrikeList     = new List <Vector3>();

            Instance.Vectors.Add(Position);

            EffectManager.sendEffect(Instance.Configuration.Instance.AirstrikeLocationEffectID, EffectManager.INSANE, GetGround(Position).Value);

            if (Instance.Configuration.Instance.LogAirstrikes)
            {
                callerPosition  = uCaller.Position;
                AirstrikeCount += 1;
            }
            if (Instance.Configuration.Instance.BroadcastAirstrikes)
            {
                UnturnedChat.Say($"Incomming Airstrike in {Instance.Configuration.Instance.StartDelay} Seconds! The Location is marked on your Map! Get into cover!", Color.yellow);
            }

            foreach (SteamPlayer sPlayer in Provider.clients)
            {
                UnturnedPlayer uPlayer = UnturnedPlayer.FromSteamPlayer(sPlayer);
                uPlayer.Player.quests.askSetMarker(uPlayer.CSteamID, true, Position);
            }
            yield return(new WaitForSeconds(Instance.Configuration.Instance.StartDelay));

            Instance.Vectors.Remove(Position);

            DateTime beforeStrike = DateTime.Now;

            for (int i = 0; i < Instance.Configuration.Instance.StrikeCount; i++)
            {
                yield return(new WaitForSeconds(UnityEngine.Random.Range(Instance.Configuration.Instance.StrikeDelayMin, Instance.Configuration.Instance.StrikeDelayMax)));

                Vector3 airstrikeLocation = new Vector3(UnityEngine.Random.Range(Position.x - Instance.Configuration.Instance.DamageIntensity, Position.x + Instance.Configuration.Instance.DamageRadius), Position.y + 300, UnityEngine.Random.Range(Position.z - Instance.Configuration.Instance.DamageRadius, Position.z + Instance.Configuration.Instance.DamageRadius));
                Ray     airstrikeRay      = new Ray(airstrikeLocation, Vector3.down);

                if (Physics.Raycast(airstrikeRay, out RaycastHit Hit))
                {
                    EffectManager.sendEffect(Instance.Configuration.Instance.StrikeExplosionEffectID, EffectManager.INSANE, Hit.point);
                    List <EPlayerKill> killList = new List <EPlayerKill>();
                    DamageTool.explode(Hit.point, Instance.Configuration.Instance.DamageIntensity, EDeathCause.MISSILE, uCaller.CSteamID, 200, 200, 200, 200, 200, 200, 200, 200, out killList, EExplosionDamageType.CONVENTIONAL, 32, true, false, EDamageOrigin.Rocket_Explosion, ERagdollEffect.NONE);
                    killList.Clear();
                    if (Instance.Configuration.Instance.LogAirstrikes)
                    {
                        StrikeList.Add(Hit.point);
                    }
                }
            }
            DateTime afterStrike = DateTime.Now;

            if (Instance.Configuration.Instance.LogAirstrikes)
            {
                LogAirstrike($"[{DateTime.Now.ToString("yyy/MM/dd h:mm:ss tt")}]\n\nUser:\n{uCaller.DisplayName} [{uCaller.Id}].\n\nAirstrike Start Delay:\n{Instance.Configuration.Instance.StartDelay} seconds.\n\nStrikes:\n{Instance.Configuration.Instance.StrikeCount}.\n\nAverage Strike Time:\n{(Instance.Configuration.Instance.StrikeDelayMin + Instance.Configuration.Instance.StrikeDelayMax) / 2} seconds.\n\nCaller Position:\n{callerPosition}.\n\nAirstrike Location:\n{Position}.\n\nDistance from Caller:\n{(int)Vector3.Distance(callerPosition, Position)}M.\n\nDamage Intensity:\n{Instance.Configuration.Instance.DamageIntensity}.\n\nStrike Radius:\n{Instance.Configuration.Instance.DamageRadius}M.\n\nAirstrikes this Uptime: {AirstrikeCount}.\n\nThis Airstrike lasted {Math.Round((afterStrike - beforeStrike).TotalSeconds, 2)} Seconds.", StrikeList);
                StrikeList.Clear();
            }

            if (Instance.Configuration.Instance.BroadcastAirstrikes)
            {
                UnturnedChat.Say("The Airstrike is over!", Color.yellow);
            }

            foreach (SteamPlayer sPlayer in Provider.clients)
            {
                UnturnedPlayer uPlayer = UnturnedPlayer.FromSteamPlayer(sPlayer);
                uPlayer.Player.quests.askSetMarker(uPlayer.CSteamID, false, Position);
            }
            yield return(new WaitForSeconds(Instance.Configuration.Instance.LocationFadeTime));

            EffectManager.askEffectClearByID(Instance.Configuration.Instance.AirstrikeLocationEffectID, uCaller.CSteamID);
        }
Пример #60
0
 void Awake()
 {
     button = GetComponent<Button>();
     audioManager = GameObject.Find("AudioManager").GetComponent<AudioManager>();
     effectManager = GameObject.Find("EffectManager").GetComponent<EffectManager>();
 }