예제 #1
0
        public static void CalcUnitLevelStatus(UnitParam unit, int unitLv, ref BaseStatus status)
        {
            GrowParam growParam = MonoSingleton <GameManager> .GetInstanceDirect().GetGrowParam((string)unit.grow);

            if (growParam != null && growParam.curve != null)
            {
                growParam.CalcLevelCurveStatus(unitLv, ref status, unit.ini_status, unit.max_status);
            }
            else
            {
                unit.ini_status.param.CopyTo(status.param);
                if (unit.ini_status.enchant_resist != null)
                {
                    unit.ini_status.enchant_resist.CopyTo(status.enchant_resist);
                }
            }
            FixParam fixParam = MonoSingleton <GameManager> .GetInstanceDirect().MasterParam.FixParam;

            status.enchant_assist.esa_fire    = (OShort)fixParam.EsaAssist;
            status.enchant_assist.esa_water   = (OShort)fixParam.EsaAssist;
            status.enchant_assist.esa_wind    = (OShort)fixParam.EsaAssist;
            status.enchant_assist.esa_thunder = (OShort)fixParam.EsaAssist;
            status.enchant_assist.esa_shine   = (OShort)fixParam.EsaAssist;
            status.enchant_assist.esa_dark    = (OShort)fixParam.EsaAssist;
            status.enchant_resist.esa_fire    = (OShort)fixParam.EsaResist;
            status.enchant_resist.esa_water   = (OShort)fixParam.EsaResist;
            status.enchant_resist.esa_wind    = (OShort)fixParam.EsaResist;
            status.enchant_resist.esa_thunder = (OShort)fixParam.EsaResist;
            status.enchant_resist.esa_shine   = (OShort)fixParam.EsaResist;
            status.enchant_resist.esa_dark    = (OShort)fixParam.EsaResist;
            status.param.rec = (OShort)fixParam.IniValRec;
        }
예제 #2
0
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                switch (Network.ErrCode)
                {
                case Network.EErrCode.GoldBuyCostShort:
                    if (this.ShowResult)
                    {
                        this.OutOfCoin();
                    }
                    this.OnBack();
                    break;

                case Network.EErrCode.GoldBuyLimit:
                    if (this.ShowResult)
                    {
                        this.OutOfBuyCount();
                    }
                    this.OnBack();
                    break;

                default:
                    this.OnRetry();
                    break;
                }
            }
            else
            {
                WebAPI.JSON_BodyResponse <Json_PlayerDataAll> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <Json_PlayerDataAll> >(www.text);
                DebugUtility.Assert(jsonObject != null, "res == null");
                if (jsonObject.body == null)
                {
                    this.OnRetry();
                }
                else
                {
                    PlayerData.EDeserializeFlags flag = (PlayerData.EDeserializeFlags)(0 | 2 | 1);
                    if (!MonoSingleton <GameManager> .Instance.Player.Deserialize(jsonObject.body.player, flag))
                    {
                        this.OnRetry();
                    }
                    else
                    {
                        Network.RemoveAPI();
                        AnalyticsManager.TrackOriginalCurrencyUse(ESaleType.Coin, this.getRequiredCoin(), "BuyGold");
                        if (this.ShowResult)
                        {
                            FixParam fixParam = MonoSingleton <GameManager> .Instance.MasterParam.FixParam;
                            UIUtility.SystemMessage((string)null, LocalizedText.Get("sys.GOLDBOUGHT", (object)fixParam.BuyGoldCost, (object)fixParam.BuyGoldAmount), (UIUtility.DialogResultEvent)(go => {}), (GameObject)null, false, -1);
                            MonoSingleton <GameManager> .Instance.Player.OnGoldChange((int)fixParam.BuyGoldAmount);
                        }
                        this.Success();
                    }
                }
            }
        }
예제 #3
0
        private bool CheckArtifactSlot(int slot, JobData job, UnitData unit)
        {
            if (job == null || unit == null)
            {
                return(false);
            }
            int      awakeLv  = unit.AwakeLv;
            FixParam fixParam = MonoSingleton <GameManager> .GetInstanceDirect().MasterParam.FixParam;

            if (fixParam == null || fixParam.EquipArtifactSlotUnlock == null || (fixParam.EquipArtifactSlotUnlock.Length <= 0 || fixParam.EquipArtifactSlotUnlock.Length < slot))
            {
                return(false);
            }
            return((int)fixParam.EquipArtifactSlotUnlock[slot] <= awakeLv);
        }
예제 #4
0
 public override void OnActivate(int pinID)
 {
     if (pinID != 0 || ((Behaviour)this).get_enabled())
     {
         return;
     }
     if (this.Confirm)
     {
         FixParam fixParam = MonoSingleton <GameManager> .Instance.MasterParam.FixParam;
         FlowNode_BuyGold.ConfirmBoxObj = UIUtility.ConfirmBox(LocalizedText.Get("sys.BUYGOLD", (object)fixParam.BuyGoldCost, (object)fixParam.BuyGoldAmount, (object)MonoSingleton <GameManager> .Instance.Player.PaidCoin, (object)(MonoSingleton <GameManager> .Instance.Player.FreeCoin + MonoSingleton <GameManager> .Instance.Player.ComCoin)), new UIUtility.DialogResultEvent(this.OnBuy), (UIUtility.DialogResultEvent)null, (GameObject)null, false, -1, (string)null, (string)null);
     }
     else
     {
         this.SendRequest();
     }
 }
예제 #5
0
        public static void CalcUnitElementStatus(EElement element, ref BaseStatus status)
        {
            FixParam fixParam = MonoSingleton <GameManager> .GetInstanceDirect().MasterParam.FixParam;

            int          elementResistUpRate   = (int)fixParam.ElementResistUpRate;
            int          elementResistDownRate = (int)fixParam.ElementResistDownRate;
            EElement     weakElement           = UnitParam.GetWeakElement(element);
            EElement     resistElement         = UnitParam.GetResistElement(element);
            ElementParam elementResist1;
            EElement     index1;

            (elementResist1 = status.element_resist)[index1 = weakElement] = (OShort)((int)elementResist1[index1] + elementResistDownRate);
            ElementParam elementResist2;
            EElement     index2;

            (elementResist2 = status.element_resist)[index2 = resistElement] = (OShort)((int)elementResist2[index2] + elementResistUpRate);
        }
예제 #6
0
        public override void OnActivate(int pinID)
        {
            if (pinID != 0 || ((Behaviour)this).get_enabled())
            {
                return;
            }
            PlayerData player = MonoSingleton <GameManager> .Instance.Player;

            if (this.Confirm)
            {
                FixParam fixParam = MonoSingleton <GameManager> .Instance.MasterParam.FixParam;
                FlowNode_BuyStamina.ConfirmBoxObj = UIUtility.ConfirmBox(LocalizedText.Get("sys.RESET_STAMINA", (object)player.GetStaminaRecoveryCost(false), (object)fixParam.StaminaAdd), new UIUtility.DialogResultEvent(this.OnBuy), (UIUtility.DialogResultEvent)null, (GameObject)null, false, -1, (string)null, (string)null);
            }
            else
            {
                this.SendRequest();
            }
        }
예제 #7
0
        private void OutOfCoin()
        {
            FixParam fixParam = MonoSingleton <GameManager> .Instance.MasterParam.FixParam;

            UIUtility.NegativeSystemMessage((string)null, LocalizedText.Get("sys.OUTOFCOIN", (object)fixParam.BuyGoldCost, (object)fixParam.BuyGoldAmount), (UIUtility.DialogResultEvent)(go => {}), (GameObject)null, false, -1);
        }
예제 #8
0
        public BuffAttachment MakeBuff(Unit gimmick, Unit target)
        {
            BuffAttachment buffAttachment = new BuffAttachment();

            switch (this.GimmickType)
            {
            case EEventGimmick.AtkUp:
            case EEventGimmick.DefUp:
            case EEventGimmick.MagUp:
            case EEventGimmick.MndUp:
            case EEventGimmick.RecUp:
            case EEventGimmick.SpdUp:
            case EEventGimmick.CriUp:
            case EEventGimmick.LukUp:
            case EEventGimmick.MovUp:
                FixParam            fixParam            = MonoSingleton <GameManager> .Instance.MasterParam.FixParam;
                int                 gemsBuffValue       = (int)fixParam.GemsBuffValue;
                int                 gemsBuffTurn        = (int)fixParam.GemsBuffTurn;
                SkillParamCalcTypes skillParamCalcTypes = SkillParamCalcTypes.Scale;
                if (this.GimmickType == EEventGimmick.AtkUp)
                {
                    buffAttachment.status.param.atk = (OShort)gemsBuffValue;
                }
                if (this.GimmickType == EEventGimmick.DefUp)
                {
                    buffAttachment.status.param.def = (OShort)gemsBuffValue;
                }
                if (this.GimmickType == EEventGimmick.MagUp)
                {
                    buffAttachment.status.param.mag = (OShort)gemsBuffValue;
                }
                if (this.GimmickType == EEventGimmick.MndUp)
                {
                    buffAttachment.status.param.mnd = (OShort)gemsBuffValue;
                }
                if (this.GimmickType == EEventGimmick.RecUp)
                {
                    buffAttachment.status.param.rec = (OShort)gemsBuffValue;
                }
                if (this.GimmickType == EEventGimmick.SpdUp)
                {
                    buffAttachment.status.param.spd = (OShort)gemsBuffValue;
                }
                if (this.GimmickType == EEventGimmick.CriUp)
                {
                    buffAttachment.status.param.cri = (OShort)gemsBuffValue;
                }
                if (this.GimmickType == EEventGimmick.LukUp)
                {
                    buffAttachment.status.param.luk = (OShort)gemsBuffValue;
                }
                if (this.GimmickType == EEventGimmick.MovUp)
                {
                    buffAttachment.status.param.mov = (OShort)2;
                    skillParamCalcTypes             = SkillParamCalcTypes.Add;
                }
                buffAttachment.user         = gimmick;
                buffAttachment.BuffType     = BuffTypes.Buff;
                buffAttachment.CalcType     = skillParamCalcTypes;
                buffAttachment.CheckTarget  = target;
                buffAttachment.CheckTiming  = EffectCheckTimings.ActionStart;
                buffAttachment.UseCondition = ESkillCondition.None;
                buffAttachment.IsPassive    = (OBool)false;
                buffAttachment.turn         = (OInt)gemsBuffTurn;
                break;
            }
            return(buffAttachment);
        }
예제 #9
0
        public void ExecuteGimmickEffect(Unit gimmick, Unit target, LogMapEvent log = null)
        {
            switch (this.GimmickType)
            {
            case EEventGimmick.Heal:
                int hp  = (int)target.MaximumStatus.param.hp;
                int num = Math.Min(hp * this.IntValue / 100, hp - (int)target.CurrentStatus.param.hp);
                target.Heal(num);
                if (log == null)
                {
                    break;
                }
                log.heal = num;
                break;

            case EEventGimmick.AtkUp:
            case EEventGimmick.DefUp:
            case EEventGimmick.MagUp:
            case EEventGimmick.MndUp:
            case EEventGimmick.RecUp:
            case EEventGimmick.SpdUp:
            case EEventGimmick.CriUp:
            case EEventGimmick.LukUp:
            case EEventGimmick.MovUp:
                BuffAttachment      buff                = new BuffAttachment();
                FixParam            fixParam            = MonoSingleton <GameManager> .Instance.MasterParam.FixParam;
                int                 gemsBuffValue       = (int)fixParam.GemsBuffValue;
                int                 gemsBuffTurn        = (int)fixParam.GemsBuffTurn;
                SkillParamCalcTypes skillParamCalcTypes = SkillParamCalcTypes.Scale;
                if (this.GimmickType == EEventGimmick.AtkUp)
                {
                    buff.status.param.atk = (OShort)gemsBuffValue;
                }
                if (this.GimmickType == EEventGimmick.DefUp)
                {
                    buff.status.param.def = (OShort)gemsBuffValue;
                }
                if (this.GimmickType == EEventGimmick.MagUp)
                {
                    buff.status.param.mag = (OShort)gemsBuffValue;
                }
                if (this.GimmickType == EEventGimmick.MndUp)
                {
                    buff.status.param.mnd = (OShort)gemsBuffValue;
                }
                if (this.GimmickType == EEventGimmick.RecUp)
                {
                    buff.status.param.rec = (OShort)gemsBuffValue;
                }
                if (this.GimmickType == EEventGimmick.SpdUp)
                {
                    buff.status.param.spd = (OShort)gemsBuffValue;
                }
                if (this.GimmickType == EEventGimmick.CriUp)
                {
                    buff.status.param.cri = (OShort)gemsBuffValue;
                }
                if (this.GimmickType == EEventGimmick.LukUp)
                {
                    buff.status.param.luk = (OShort)gemsBuffValue;
                }
                if (this.GimmickType == EEventGimmick.MovUp)
                {
                    buff.status.param.mov = (OShort)2;
                    skillParamCalcTypes   = SkillParamCalcTypes.Add;
                }
                buff.user         = gimmick;
                buff.BuffType     = BuffTypes.Buff;
                buff.CalcType     = skillParamCalcTypes;
                buff.CheckTarget  = target;
                buff.CheckTiming  = EffectCheckTimings.ActionStart;
                buff.UseCondition = ESkillCondition.None;
                buff.IsPassive    = (OBool)false;
                buff.turn         = (OInt)gemsBuffTurn;
                target.SetBuffAttachment(buff, false);
                if (log == null)
                {
                    break;
                }
                BattleCore.SetBuffBits(buff.status, ref log.buff, ref log.debuff);
                break;
            }
        }