コード例 #1
0
        public ProjectEternityUnitModularEditor()
        {
            InitializeComponent();

            ListPilot = new List <Character>();

            ListHead     = new List <PartHead>();
            ListTorso    = new List <PartTorso>();
            ListLeftArm  = new List <PartArm>();
            ListRightArm = new List <PartArm>();
            ListLegs     = new List <PartLegs>();

            DicRequirement = BaseSkillRequirement.LoadAllRequirements();
            DicEffect      = BaseEffect.LoadAllEffects();

            ResetControls();
        }
コード例 #2
0
        public SkillLevelsEditor(string SkillName)
        {
            InitializeComponent();

            DicRequirement = BaseSkillRequirement.LoadAllRequirements();
            DicEffect      = BaseEffect.LoadAllEffects();

            lblName.Text = SkillName;
            dgvLevels.Rows.Clear();

            BaseAutomaticSkill NewSkill = new BaseAutomaticSkill("Content/Characters/Skills/" + SkillName + ".pecs", DicRequirement, DicEffect);

            for (int L = 0; L < NewSkill.ListSkillLevel.Count; ++L)
            {
                dgvLevels.Rows.Add(L + 1, L + 1);
            }
        }
コード例 #3
0
        public override void ExecuteAndAddEffectToTarget(BaseEffect ActiveSkillEffect, string SkillName)
        {
            string LifeType = "";

            if (ActiveSkillEffect.LifetimeType == SkillEffect.LifetimeTypeTurns)
            {
                LifeType = SkillEffect.LifetimeTypeTurns + GlobalContext.Map.ActivePlayerIndex;
            }

            for (int U = GlobalContext.EffectOwnerSquad.UnitsAliveInSquad - 1; U >= 0; --U)
            {
                GlobalContext.SetContext(GlobalContext.EffectOwnerSquad, GlobalContext.EffectOwnerUnit, GlobalContext.EffectOwnerCharacter,
                                         GlobalContext.EffectOwnerSquad, GlobalContext.EffectOwnerSquad[U], GlobalContext.EffectTargetUnit.Pilot, GlobalContext.ActiveParser);

                GlobalContext.EffectTargetUnit.Pilot.Effects.AddAndExecuteEffect(ActiveSkillEffect, SkillName, LifeType);
            }
        }
コード例 #4
0
        public void ReloadSkills(Dictionary <string, BaseSkillRequirement> DicRequirement, Dictionary <string, BaseEffect> DicEffect,
                                 Dictionary <string, AutomaticSkillTargetType> DicAutomaticSkillTarget, Dictionary <string, ManualSkillTarget> DicManualSkillTarget)
        {
            Target = DicManualSkillTarget[Target.TargetType].Copy();

            for (int E = 0; E < ListEffect.Count; E++)
            {
                BaseEffect NewEffect = DicEffect[ListEffect[E].EffectTypeName].Copy();
                NewEffect.CopyMembers(ListEffect[E]);
                ListEffect[E] = NewEffect;

                foreach (BaseAutomaticSkill ActiveFollowingSkill in ListEffect[E].ListFollowingSkill)
                {
                    ActiveFollowingSkill.ReloadSkills(DicRequirement, DicEffect, DicAutomaticSkillTarget);
                }
            }
        }
コード例 #5
0
        private void cboEffectType_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (!AllowEvents)
            {
                return;
            }

            if (lstLevels.SelectedItems.Count > 0 && lstActivations.SelectedItems.Count > 0 && lstEffects.SelectedItems.Count > 0)
            {
                BaseEffect NewSkillEffect = ((BaseEffect)cboEffectType.SelectedItem).Copy();
                BaseEffect OldSkillEffect = ActiveSkill.ListSkillLevel[lstLevels.SelectedIndex].ListActivation[lstActivations.SelectedIndex].ListEffect[lstEffects.SelectedIndex];

                NewSkillEffect.CopyMembers(OldSkillEffect);

                ActiveSkill.ListSkillLevel[lstLevels.SelectedIndex].ListActivation[lstActivations.SelectedIndex].ListEffect[lstEffects.SelectedIndex] = NewSkillEffect;
                lstEffects.Items[lstEffects.SelectedIndex] = NewSkillEffect.ToString();
            }
        }
コード例 #6
0
        private void lstEffects_SelectedIndexChanged(object sender, EventArgs e)
        {
            TreeNode SelectedNode = tvSkills.SelectedNode;

            if (lstEffects.SelectedIndex >= 0 && SelectedNode != null)
            {
                BaseAutomaticSkill ActiveSkill = SelectedNode.Tag as BaseAutomaticSkill;
                while (ActiveSkill == null)
                {
                    SelectedNode = SelectedNode.Parent;
                    ActiveSkill  = SelectedNode.Tag as BaseAutomaticSkill;
                }
                BaseEffect ActiveEffect = ActiveSkill.ListSkillLevel[0].ListActivation[0].ListEffect[lstEffects.SelectedIndex];

                cboEffectType.Text      = ActiveEffect.ToString();
                pgEffect.SelectedObject = ActiveEffect;
            }
        }
コード例 #7
0
 public override void WriteBinary(ESPWriter writer)
 {
     if (BaseEffect != null)
     {
         BaseEffect.WriteBinary(writer);
     }
     if (EffectData != null)
     {
         EffectData.WriteBinary(writer);
     }
     if (Conditions != null)
     {
         foreach (var item in Conditions)
         {
             item.WriteBinary(writer);
         }
     }
 }
コード例 #8
0
        public override void ExecuteAndAddEffectToTarget(BaseEffect ActiveSkillEffect, string SkillName)
        {
            for (int P = GlobalContext.Map.ListPlayer.Count - 1; P >= 0; --P)
            {
                if (GlobalContext.Map.ListPlayer[P].Team == GlobalContext.Map.ListPlayer[GlobalContext.Map.ActivePlayerIndex].Team)
                {
                    continue;
                }

                for (int S = GlobalContext.Map.ListPlayer[P].ListSquad.Count - 1; S >= 0; --S)
                {
                    for (int U = GlobalContext.Map.ListPlayer[P].ListSquad[S].UnitsAliveInSquad - 1; U >= 0; --U)
                    {
                        GlobalContext.Map.ListPlayer[P].ListSquad[S][U].Pilot.Effects.AddAndExecuteEffect(ActiveSkillEffect, SkillName);
                    }
                }
            }
        }
コード例 #9
0
        public override void ReadBinary(ESPReader reader)
        {
            List <string> readTags = new List <string>();

            while (reader.BaseStream.Position < reader.BaseStream.Length)
            {
                string subTag = reader.PeekTag();

                switch (subTag)
                {
                case "EFID":
                    if (readTags.Contains("EFID"))
                    {
                        return;
                    }
                    BaseEffect.ReadBinary(reader);
                    break;

                case "EFIT":
                    if (readTags.Contains("EFIT"))
                    {
                        return;
                    }
                    EffectData.ReadBinary(reader);
                    break;

                case "CTDA":
                    if (Conditions == null)
                    {
                        Conditions = new List <Condition>();
                    }

                    Condition tempCTDA = new Condition();
                    tempCTDA.ReadBinary(reader);
                    Conditions.Add(tempCTDA);
                    break;

                default:
                    return;
                }

                readTags.Add(subTag);
            }
        }
コード例 #10
0
        public override void LoadEffects()
        {
            base.LoadEffects();

            foreach (KeyValuePair <string, BaseEffect> ActiveEffect in BaseEffect.LoadFromAssemblyFiles(Directory.GetFiles("Effects/Deathmatch Map", "*.dll"), typeof(DeathmatchEffect), new DeathmatchParams(GlobalDeathmatchContext)))
            {
                DicEffect.Add(ActiveEffect.Key, ActiveEffect.Value);
            }

            List <Assembly> ListAssembly = RoslynWrapper.GetCompiledAssembliesFromFolder("Effects/Deathmatch Map", "*.csx", SearchOption.TopDirectoryOnly);

            foreach (Assembly ActiveAssembly in ListAssembly)
            {
                foreach (KeyValuePair <string, BaseEffect> ActiveEffect in BaseEffect.LoadFromAssembly(ActiveAssembly, typeof(DeathmatchEffect), new DeathmatchParams(GlobalDeathmatchContext)))
                {
                    DicEffect.Add(ActiveEffect.Key, ActiveEffect.Value);
                }
            }
        }
コード例 #11
0
        private void DrawLights()
        {
            BaseEffect effect  = this.SpawnMesh.Effect;
            Texture    texture = this.SpawnMesh.FirstGroup.Texture;

            this.SpawnMesh.FirstGroup.Texture = (Texture)null;
            this.SpawnMesh.Effect             = (BaseEffect)GlitchyRespawner.FullbrightEffect;
            this.SpawnMesh.Draw();
            this.SpawnMesh.FirstGroup.Texture = texture;
            this.SpawnMesh.Effect             = effect;
            if (this.SinceAlive.TotalSeconds <= 2.0)
            {
                return;
            }
            this.SpawnMesh.Material.Opacity = FezMath.Saturate(Easing.EaseIn((this.SinceAlive.TotalSeconds - 2.0) / 0.25, EasingType.Quadratic));
            (this.SpawnMesh.Effect as CubemappedEffect).Pass = LightingEffectPass.Pre;
            this.SpawnMesh.Draw();
            (this.SpawnMesh.Effect as CubemappedEffect).Pass = LightingEffectPass.Main;
        }
コード例 #12
0
        public VisualNovelCharacter(BinaryReader BR)
        {
            this.CharacterName = BR.ReadString();

            int ListSpeakerPriorityCounter = BR.ReadInt32();

            ListSpeakerPriority = new List <SpeakerPriority>(ListSpeakerPriorityCounter);
            for (int S = 0; S < ListSpeakerPriorityCounter; ++S)
            {
                ListSpeakerPriority.Add(new SpeakerPriority((SpeakerPriority.PriorityTypes)BR.ReadByte(), BR.ReadString()));
            }

            Dictionary <string, BaseSkillRequirement>     DicRequirement          = BaseSkillRequirement.LoadAllRequirements();
            Dictionary <string, BaseEffect>               DicEffect               = BaseEffect.LoadAllEffects();
            Dictionary <string, AutomaticSkillTargetType> DicAutomaticSkillTarget = AutomaticSkillTargetType.LoadAllTargetTypes();
            Dictionary <string, ManualSkillTarget>        DicManualSkillTarget    = ManualSkillTarget.LoadAllTargetTypes();

            _LoadedCharacter = new Character(CharacterName, null, DicRequirement, DicEffect, DicAutomaticSkillTarget, DicManualSkillTarget);
        }
コード例 #13
0
        public void LoadCharactersLoadout()
        {
            FileStream   FS = new FileStream("Content/New game characters loadout.txt", FileMode.Open, FileAccess.ReadWrite);
            StreamReader SR = new StreamReader(FS);

            Dictionary <string, BaseSkillRequirement> DicRequirement = BaseSkillRequirement.LoadAllRequirements();
            Dictionary <string, BaseEffect>           DicEffect      = BaseEffect.LoadAllEffects();

            //Read everything
            while (!SR.EndOfStream)
            {
                string PilotName = SR.ReadLine();

                Character NewCharacter = new Character(PilotName, GameScreen.ContentFallback, DicRequirement, DicEffect);
                NewCharacter.Level = 1;
                TeamCharacters.ListAll.Add(NewCharacter);
            }
            FS.Close();
        }
コード例 #14
0
    private void HandleCllisionEffect()     //处理碰撞效果
    {
        List <string> effectList      = null;
        BaseEffect    collisionEffect = null;

        if (_generation == 0)
        {
            effectList = _firstCollisionEffect;
        }
        else
        {
            effectList = _collisionEffect;
        }
        for (int i = 0; i < effectList.Count; i++)
        {
            collisionEffect = EFFECT.Create(effectList[i], _caster, _source, _target);
            collisionEffect.StartUp();
        }
    }
コード例 #15
0
    /// <summary>
    /// 受击火花特效
    /// </summary>
    public void AddFlashEffect()
    {
        GameObject prefab = ResourceManager.GetInstance.LoadPrefab(TestData.charDB [6].Prefab);
        GameObject parent = StageManager.SharedInstance.EffectLayer;
        GameObject go     = StageManager.SharedInstance.AddToStage(parent, prefab);

        BaseEffect baseEffect = go.AddComponent <BaseEffect> ();

        //baseEffect.transform.position  = gameObject.transform.position;

        //Vector3 pos = MapUtil.RelativeMovePosition (battleAgent.BaseSprite.HitPoint, battleAgent.GameObject.transform);
        //baseEffect.transform.position = new Vector3 (pos.x, pos.y, battleAgent.GameObject.transform.position.z);

        baseEffect.transform.position = MapUtil.GetHitPointWorld(battleAgent);

        AttackMessage message = new AttackMessage(battleAgent, battleAgent.Targets, 1);

        baseEffect.PlayOnAgent(message);
    }
コード例 #16
0
ファイル: EFFECT.cs プロジェクト: Alex-1992/poeproject
    public static BaseEffect Create(string type, BaseUnit caster, BaseUnit source, BaseUnit target)
    {
        BaseEffect effect = null;

        switch (type)
        {
        case EffectType.EffectProjectile:
            effect = new EffectProjectile();
            break;

        case EffectType.EffectDamage:
            effect = new EffectDamage();
            break;

        default:
            effect = new BaseEffect();
            break;
        }
        return(effect);
    }
コード例 #17
0
    void DrawAddEffect(ref Boost pBoost)
    {
        EditorGUILayout.BeginHorizontal();

        m_CurrentEffectType = (BaseEffect.EFFECT_TYPE)EditorGUILayout.EnumPopup(m_CurrentEffectType);

        if (GUILayout.Button("Add Effect"))
        {
            if (pBoost.Effects == null)
            {
                pBoost.Effects = new List <Boost.Effect>();
            }
            Boost.Effect tEffect = new Boost.Effect();
            tEffect.Type     = m_CurrentEffectType;
            tEffect.m_Effect = BaseEffect.GetEffectObject(tEffect.Type);
            pBoost.Effects.Add(tEffect);
        }

        EditorGUILayout.EndHorizontal();
    }
コード例 #18
0
        public UnitNormalEditor()
        {
            InitializeComponent();
            FilePath = null;

            frmAttacks        = new Attacks();
            frmDetails        = new DetailsEditor();
            frmUnitSizeEditor = new UnitSizeEditor();

            DicRequirement          = BaseSkillRequirement.LoadAllRequirements();
            DicEffect               = BaseEffect.LoadAllEffects();
            DicAutomaticSkillTarget = AutomaticSkillTargetType.LoadAllTargetTypes();

            txtName.Text        = "";
            txtPrice.Text       = "0";
            txtDescription.Text = "";

            txtBaseHP.Text       = "0";
            txtBaseEN.Text       = "0";
            txtBaseArmor.Text    = "0";
            txtBaseMobility.Text = "0";
            txtBaseMovement.Text = "0";
            txtPartsSlots.Value  = 1;

            lstPilots.Items.Clear();

            lstAnimations.Items.Add(new ListViewItem("Default"));
            lstAnimations.Items.Add(new ListViewItem("Hit"));
            lstAnimations.Items.Add(new ListViewItem("Hit To Default"));
            lstAnimations.Items.Add(new ListViewItem("Move Foward"));
            lstAnimations.Items.Add(new ListViewItem("Move Foward To Default"));
            lstAnimations.Items.Add(new ListViewItem("Move Backward"));
            lstAnimations.Items.Add(new ListViewItem("Move Backward To Default"));
            lstAnimations.Items.Add(new ListViewItem("Destroyed"));
            lstAnimations.Items.Add(new ListViewItem("Shield"));
            lstAnimations.Items.Add(new ListViewItem("Shield To Default"));
            lstAnimations.Items.Add(new ListViewItem("Parry Start"));
            lstAnimations.Items.Add(new ListViewItem("Parry End"));
            lstAnimations.Items.Add(new ListViewItem("Shoot Down Firing"));
            lstAnimations.Items.Add(new ListViewItem("Shoot Down Shot"));
        }
コード例 #19
0
        public override void Execute()
        {
            var em = EffectLoader.Load(filename, (fn) =>
            {
                var image = Image.FromFile(fn);
                if (!ImagePool.ContainsKey(fn))
                {
                    ImagePool.Add(fn, image);
                }
            }
                                       );
            var be = new BaseEffect
            {
                Filename = filename
            };

            be.SetDefault();
            be.Effects = em.Effects;
            be.FPS     = em.FPS;
            manager.Effects.Insert(insertindex, be);
        }
コード例 #20
0
 public override void Execute()
 {
     try
     {
         var image = Image.FromFile(filename);
         if (!imagepool.ContainsKey(filename))
         {
             imagepool.Add(filename, image);
         }
         var be = new BaseEffect
         {
             Filename = filename
         };
         be.SetDefault();
         manager.Effects.Insert(insertindex, be);
     }
     catch (Exception e)
     {
         throw new Exception("Failed to load image", e);
     }
 }
コード例 #21
0
 public void ApplyEffects()
 {
     for (int i = 0; i < m_Boosts.Count; i++)
     {
         if (m_Boosts[i].IsInEffect)
         {
             if (m_Boosts[i].Effects != null)
             {
                 List <Boost.Effect> tBoardEffects = m_Boosts[i].Effects;
                 if (tBoardEffects != null)
                 {
                     for (int k = 0; k < tBoardEffects.Count; k++)
                     {
                         BaseEffect tBaseEffect = BaseEffect.GetEffectObject(tBoardEffects[k].Type, tBoardEffects[k].EffectToRun);
                         tBaseEffect.Effect(m_pBoard);
                     }
                 }
             }
         }
     }
 }
コード例 #22
0
    /// <summary>
    /// 黑色落位效果
    /// </summary>
    public void AddBlackDownEffect()
    {
        GameObject downPrefab = ResourceManager.GetInstance.LoadPrefab(TestData.charDB [25].Prefab);
        GameObject parent     = StageManager.SharedInstance.EffectLayer;
        GameObject down       = StageManager.SharedInstance.AddToStage(parent, downPrefab);

        Image img = down.GetComponent <Image> ();

        img.color = new Color(1.0f, 1.0f, 1.0f, 0.5f);

        BaseEffect baseEffect = down.AddComponent <BaseEffect> ();

        //Vector3 pos = MapUtil.GetInstance.MapToWorld (mapPos.x, mapPos.y);

        baseEffect.transform.position      = gameObject.transform.position;
        baseEffect.transform.localPosition = new Vector3(baseEffect.transform.localPosition.x, baseEffect.transform.localPosition.y + 300, baseEffect.transform.localPosition.z);

        AttackMessage message = new AttackMessage(battleAgent, battleAgent.Targets, 1);

        baseEffect.PlayOnAgent(message);
    }
コード例 #23
0
        private void AddSkillNode()
        {
            BaseAutomaticSkill NewSkill = new BaseAutomaticSkill();

            NewSkill.Name = "Dummy Skill";
            NewSkill.ListSkillLevel.Add(new BaseSkillLevel());
            NewSkill.CurrentLevel = 1;

            BaseSkillActivation NewActivation = new BaseSkillActivation();

            NewSkill.CurrentSkillLevel.ListActivation.Add(NewActivation);

            NewActivation.ListRequirement.Add(DicRequirement.First().Value.Copy());
            NewActivation.ListEffectTarget.Add(new List <string>());
            NewActivation.ListEffect.Add(DicEffect.First().Value.Copy());

            TreeNode SelectedNode = tvSkills.SelectedNode;

            if (SelectedNode != null)
            {
                BaseAutomaticSkill ActiveSkill = SelectedNode.Tag as BaseAutomaticSkill;
                while (ActiveSkill == null)
                {
                    SelectedNode = SelectedNode.Parent;
                    ActiveSkill  = SelectedNode.Tag as BaseAutomaticSkill;
                }

                BaseEffect ActiveEffect = ActiveSkill.ListSkillLevel[0].ListActivation[0].ListEffect[lstEffects.SelectedIndex];
                ActiveEffect.ListFollowingSkill.Add(NewSkill);
            }

            if (tvSkills.SelectedNode != null)
            {
                CreateTree(NewSkill, tvSkills.SelectedNode.Nodes);
            }
            else
            {
                CreateTree(NewSkill, tvSkills.Nodes);
            }
        }
コード例 #24
0
        private bool HandleSpecific(EffectContext context, out decimal value)
        {
            if (context.Equals(StaticEffectContext.CriticalDamage))
            {
                var criticalDamage = SafeReadStaticEffect(StaticEffectContext.CriticalDamage) ?? 0;
                var attack         = SafeReadStaticEffect(StaticEffectContext.Attack) ?? 0;

                value = (int)(criticalDamage + attack * .8m);
                return(true);
            }

            if (context.Equals(StaticEffectContext.Hp))
            {
                var hp     = SafeReadStaticEffect(StaticEffectContext.Hp) ?? 0;
                var hpRate = SafeReadStaticEffect(StaticEffectContext.HpRate) ?? 0;
                var baseHp = _character.Get() !.BaseEffect.First(x => x.Context.Equals(StaticEffectContext.Hp)).Value;

                value = (int)(hp + baseHp * hpRate);
                return(true);
            }

            if (context.Equals(StaticEffectContext.HpRate))
            {
                throw new ApplicationInvalidOperationException(StaticEffectContext.Hp);
            }

            // It should process by equipment itself
            if (context.Equals(StaticEffectContext.WeaponAttack) ||
                context.Equals(StaticEffectContext.WeaponAttackRate) ||
                context.Equals(StaticEffectContext.GearDefense) ||
                context.Equals(StaticEffectContext.GearDefenseRate))
            {
                Console.WriteLine($"WARN: Context {context} not handle correctly");
                value = 0;
                throw new InvalidOperationException();
            }

            value = 0;
            return(false);
        }
コード例 #25
0
        private void LoadEffects()
        {
            foreach (KeyValuePair <string, BaseEffect> ActiveEffect in BaseEffect.LoadFromAssemblyFiles(Directory.GetFiles("Effects", "*.dll"), typeof(SkillEffect), new UnitEffectParams(GlobalBattleContext, GlobalQuickLoadContext)))
            {
                DicEffect.Add(ActiveEffect.Key, ActiveEffect.Value);
            }
            foreach (KeyValuePair <string, BaseEffect> ActiveEffect in BaseEffect.LoadFromAssemblyFiles(Directory.GetFiles("Effects/Battle Map", "*.dll"), typeof(SkillEffect), new UnitEffectParams(GlobalBattleContext, GlobalQuickLoadContext)))
            {
                DicEffect.Add(ActiveEffect.Key, ActiveEffect.Value);
            }

            List <Assembly> ListAssembly = RoslynWrapper.GetCompiledAssembliesFromFolder("Effects", "*.csx", SearchOption.TopDirectoryOnly);

            foreach (Assembly ActiveAssembly in ListAssembly)
            {
                foreach (KeyValuePair <string, BaseEffect> ActiveEffect in BaseEffect.LoadFromAssembly(ActiveAssembly, typeof(SkillEffect), new UnitEffectParams(GlobalBattleContext, GlobalQuickLoadContext)))
                {
                    DicEffect.Add(ActiveEffect.Key, ActiveEffect.Value);
                }
            }

            ListAssembly = RoslynWrapper.GetCompiledAssembliesFromFolder("Effects/Battle Map", "*.csx", SearchOption.TopDirectoryOnly);
            foreach (Assembly ActiveAssembly in ListAssembly)
            {
                foreach (KeyValuePair <string, BaseEffect> ActiveEffect in BaseEffect.LoadFromAssembly(ActiveAssembly, typeof(SkillEffect), new UnitEffectParams(GlobalBattleContext, GlobalQuickLoadContext)))
                {
                    DicEffect.Add(ActiveEffect.Key, ActiveEffect.Value);
                }
            }

            foreach (KeyValuePair <string, BaseEffect> ActiveEffect in BaseEffect.LoadAllEffects())
            {
                if (!DicEffect.ContainsKey(ActiveEffect.Key))
                {
                    DicEffect.Add(ActiveEffect.Key, ActiveEffect.Value);
                }
            }
        }
コード例 #26
0
    public static void DrawTypeList(ref BaseEffect pBaseEffect, BaseEffect.EFFECT_TYPE pEffectType)
    {
        switch (pEffectType)
        {
        case BaseEffect.EFFECT_TYPE.BLOCK:
            BlockEffectDrawer tBlockEffectDrawer = new BlockEffectDrawer();

            tBlockEffectDrawer.Draw(ref pBaseEffect);
            break;

        case BaseEffect.EFFECT_TYPE.CROSS:
            CrossEffectDrawer tCrossEffectDrawer = new CrossEffectDrawer();

            tCrossEffectDrawer.Draw(ref pBaseEffect);
            break;

        case BaseEffect.EFFECT_TYPE.DESTROY_BY_TYPE:
            DestroyByTypeEffectDrawer tDestroyByTypeEffectDrawer = new DestroyByTypeEffectDrawer();

            tDestroyByTypeEffectDrawer.Draw(ref pBaseEffect);
            break;
        }
    }
コード例 #27
0
        public override bool CanExecuteEffectOnTarget(BaseEffect ActiveSkillEffect)
        {
            for (int P = GlobalContext.Map.ListPlayer.Count - 1; P >= 0; --P)
            {
                if (GlobalContext.Map.ListPlayer[P].Team == GlobalContext.Map.ListPlayer[GlobalContext.Map.ActivePlayerIndex].Team)
                {
                    continue;
                }

                for (int S = GlobalContext.Map.ListPlayer[P].ListSquad.Count - 1; S >= 0; --S)
                {
                    for (int U = GlobalContext.Map.ListPlayer[P].ListSquad[S].UnitsAliveInSquad - 1; U >= 0; --U)
                    {
                        if (ActiveSkillEffect.CanActivate())
                        {
                            return(true);
                        }
                    }
                }
            }

            return(false);
        }
コード例 #28
0
        public void LoadUnitsLoadout()
        {
            Unit.LoadAllUnits();

            FileStream   FS = new FileStream("Content/New game units loadout.txt", FileMode.Open, FileAccess.ReadWrite);
            StreamReader SR = new StreamReader(FS);

            Dictionary <string, Unit> DicUnitType = Unit.LoadAllUnits();
            Dictionary <string, BaseSkillRequirement> DicRequirement = BaseSkillRequirement.LoadAllRequirements();
            Dictionary <string, BaseEffect>           DicEffect      = BaseEffect.LoadAllEffects();

            //Read everything
            while (!SR.EndOfStream)
            {
                string UnitName = SR.ReadLine();

                string[] UnitInfo   = UnitName.Split(new[] { "\\", "/" }, StringSplitOptions.None);
                Unit     _SpawnUnit = Unit.FromType(UnitInfo[0], UnitName.Remove(0, UnitInfo[0].Length + 1), GameScreen.ContentFallback, DicUnitType, DicRequirement, DicEffect);

                TeamUnits.ListAll.Add(_SpawnUnit);
            }
            FS.Close();
        }
コード例 #29
0
        public RelationshipEditor(BaseAutomaticSkill[] ArrayRelationshipBonus)
        {
            InitializeComponent();
            AllowEvents    = false;
            DicRequirement = BaseSkillRequirement.LoadAllRequirements();
            DicEffect      = BaseEffect.LoadAllEffects();
            cboRequirementType.Items.AddRange(DicRequirement.Values.OrderBy(x => x.SkillRequirementName).ToArray());

            ListRelationshipSkill         = new List <BaseAutomaticSkill>();
            ListRelationshipSkillOriginal = new List <BaseAutomaticSkill>();

            foreach (BaseAutomaticSkill ActiveSkill in ArrayRelationshipBonus)
            {
                ListRelationshipSkill.Add(ActiveSkill);
                ListRelationshipSkillOriginal.Add(ActiveSkill);

                for (int L = 0; L < ActiveSkill.ListSkillLevel.Count; ++L)
                {
                    lstCharacters.Items.Add("Character " + (lstCharacters.Items.Count + 1));
                }
            }
            AllowEvents = true;
        }
コード例 #30
0
ファイル: EffectMgr.cs プロジェクト: ottoGithub/Project_Z_two
    public int createEffect(int effId, EffectInfo info)
    {
        EffectConfigConfig config = EffectConfigConfig.Get(effId);
        int uid = -1;

        if (config != null)
        {
            uid         = MathUtils.get32UID();
            info.config = config;
            GameObject cacheGo = PoolMgr.Instance.getObj(config.tempId + config.path);
            if (cacheGo == null)
            {
                ResMgr.Instance.load(effectPathPre + config.path, (obj) =>
                {
                    GameObject go = obj as GameObject;
                    BaseEffect be = go.AddComponent(getType((EffectType)config.effectType)) as BaseEffect;
                    be.id         = uid;
                    be.setInfo(info);
                    if (!createdEff.ContainsKey(uid))
                    {
                        createdEff.Add(uid, be);
                    }
                });
            }
            else
            {
                BaseEffect be = cacheGo.GetComponent <BaseEffect>();
                if (be != null)
                {
                    be.setInfo(info);
                    cacheGo.SetActive(true);
                    uid = be.id;
                }
            }
        }
        return(uid);
    }
コード例 #31
0
ファイル: AbsorbDamageEffect.cs プロジェクト: swejk/2DRPG
 void Awake()
 {
     effect = GetTrackedEffect();
 }
コード例 #32
0
    IEnumerator PlayUltEffect(AttackMessage message)
    {
        StartCoroutine(MaskFade ());

        this.message = message;

        GameObject bulletPrefab = ResourceManager.GetInstance.LoadPrefab (TestData.charDB [7].Prefab);
        GameObject parent = StageManager.SharedInstance.WorldUltLayer;
        GameObject bullet = StageManager.SharedInstance.AddToStage (parent, bulletPrefab);
        baseEffect = bullet.AddComponent<BaseEffect> ();
        //baseEffect.transform.position = message.Sender.GameObject.transform.position;

        //Vector3 pos = MapUtil.RelativeMovePosition (battleAgent.BaseSprite.HitPoint, battleAgent.GameObject.transform);
        //baseEffect.transform.position = new Vector3 (pos.x, pos.y, battleAgent.GameObject.transform.position.z);
        BattleAgent battleAgent = message.Sender;
        baseEffect.transform.position = MapUtil.GetHitPointWorld (battleAgent);
        baseEffect.PlayOnAgent (message);
        //yield return new WaitForSeconds (0.1f);

        //addMask ();
        //Time.timeScale = 1.0f;

        battleAgent.dispatchEvent (SoldierEvent.BATTLE_MESSAGE, message);
        Time.timeScale = 0.6f;
        yield return new WaitForSeconds (0.1f);
        Time.timeScale = 1.0f;
    }