Exemple #1
0
    protected override void onPropertyChanged(int id, float oldValue, float newValue)
    {
        base.onPropertyChanged(id, oldValue, newValue);

        PropertyEvent evt = new PropertyEvent(PropertyEvent.CROPS_PROPERTY_CHANGE);

        EventSystem.Instance.PushEvent(evt);
    }
Exemple #2
0
    public override void Update(uint elapsed)
    {
        bool changed = false;

        //基础
        if (mMarks.Get((int)INF_PRO_TYPE.INF_PRO_TYPE_BASE))
        {
            changed = true;
            PropertyBuild.BuildBaseProperty(PlayerDataPool.Instance.MainData, mPlayerBaseProperty);
        }
        //装备
        if (mMarks.Get((int)INF_PRO_TYPE.INF_PRO_TYPE_EQUIP))
        {
            changed = true;

            PropertyBuild.BuildEquipProperty(PlayerDataPool.Instance.MainData, mPlayerEquipProperty);

            //更新外形信息
            PropertyBuild.BuildEquipView(PlayerDataPool.Instance.MainData, mEquipConfigs);

            Player player = PlayerController.Instance.GetControlObj() as Player;
            if (player != null)
            {
                player.ApplyEquipConfig(mEquipConfigs);
            }
        }
        //武器
        if (mMarks.Get((int)INF_PRO_TYPE.INF_PRO_TYPE_WEAPON))
        {
            changed = true;

            PropertyBuild.BuildWeaponProperty(PlayerDataPool.Instance.MainData, mPlayerWeaponProperty);
        }
        //翅膀
        if (mMarks.Get((int)INF_PRO_TYPE.INF_PRO_TYPE_WING))
        {
            changed = true;

            PropertyBuild.BuildWingProperty(PlayerDataPool.Instance.MainData, mPlayerWingProperty);
        }

        //时装
        if (mMarks.Get((int)INF_PRO_TYPE.INF_PRO_TYPE_FASHION))
        {
            changed = true;
            PropertyBuild.BuildFashionProperty(PlayerDataPool.Instance.MainData, mPlayerFashionProperty);
        }

        mMarks.SetAll(false);



        if (changed)
        {
            PropertyEvent evt = new PropertyEvent(PropertyEvent.PLAYER_DATA_PROPERTY_CHANGED);
            EventSystem.Instance.PushEvent(evt);
        }
    }
    void onPlayerFightPropChange(EventBase e)
    {
        if (!mEnable)
        {
            return;
        }

        PropertyEvent evt = (PropertyEvent)e;

        BattleUnit unit = PlayerController.Instance.GetControlObj() as BattleUnit;

        if (unit.GetMaxHP() <= 0)
        {
            mSprite.alpha = 0.0f;
        }
        else
        {
            mHpScale = (float)unit.GetHP() / (float)unit.GetMaxHP();

            if (mHpScale <= mOpenScalse)
            {
                float alpha = (mOpenScalse - mHpScale) / mOpenScalse + mBeginAlpha;

                if (!mBeginFlicker)
                {
                    mSprite.alpha = mCurAlpha = mBeginAlpha;
                    mBeginFlicker = true;
                }
                //mLastAlpha = 1.0f;
            }
            else
            {
                mSprite.alpha = 0.0f;
                mBeginFlicker = false;
            }
        }
    }
 private void Initialize() {
   recordingAct = RecordingAct.Parse(int.Parse(Request.QueryString["recordingActId"]));
   property = Property.Parse(int.Parse(Request.QueryString["propertyId"]));
   propertyEvent = recordingAct.GetPropertyEvent(property);
 }
    // 主属性变更
    public void onMainPropertyChange(EventBase evt)
    {
        PropertyEvent propertyevent = evt as PropertyEvent;

        if (!System.Enum.IsDefined(typeof(MainPropertyType), propertyevent.propertyId))
        {
            return;
        }

        if (propertyevent.propertyId != (int)MainPropertyType.PropertyType_Level)
        {
            return;
        }

        if (!mUnlockDatas.ContainsKey(ConditionType.LEVEL))
        {
            return;
        }

        ArrayList list = mUnlockDatas[ConditionType.LEVEL];

        if (list == null)
        {
            return;
        }

        // 检查是否有因此解锁的关卡
        System.Type type = typeof(Scene_StageSceneTableItem);
        foreach (StageUnlockData unlockdata in list)
        {
            if (unlockdata.condition == null)
            {
                continue;
            }

            if (unlockdata.condition.mValue != propertyevent.newValue)
            {
                continue;
            }

            if (!DataManager.Scene_StageSceneTable.ContainsKey(unlockdata.stageid))
            {
                continue;
            }

            bool success = true;
            Scene_StageSceneTableItem stageres = DataManager.Scene_StageSceneTable[unlockdata.stageid] as Scene_StageSceneTableItem;
            for (uint i = 0; i < Scene_StageSceneTableItem.MAX_UNLOCK_CONDITION_COUNT; ++i)
            {
                System.Reflection.FieldInfo fieldid = type.GetField("mUnlockCondId" + i.ToString());
                int unlockcondid = (int)fieldid.GetValue(stageres);
                if (unlockcondid < 0)
                {
                    continue;
                }

                if (!ConditionManager.Instance.CheckCondition(unlockcondid))
                {
                    success = false;
                    break;
                }
            }

            // 有因此解锁的关卡
            if (success)
            {
                UnlockStageActionParam param = new UnlockStageActionParam();
                param.stageid = unlockdata.stageid;
                Net.Instance.DoAction((int)Message.MESSAGE_ID.ID_MSG_SCENE_UNLOCK, param);
            }
        }
    }