Example #1
0
        public static void Main(string[] args)
        {
            Type weaponType = typeof(Weapon);

            var weaponAttributes = weaponType.GetCustomAttributes(false);

            WeaponAttribute myWeaponAtt = (WeaponAttribute)weaponAttributes.FirstOrDefault(x => x.GetType() == typeof(WeaponAttribute));

            string command;

            while ((command = Console.ReadLine()) != "END")
            {
                switch (command)
                {
                case "Author":
                    Console.WriteLine($"Author: {myWeaponAtt.Author}");
                    break;

                case "Revision":
                    Console.WriteLine($"Revision: {myWeaponAtt.Revision}");
                    break;

                case "Description":
                    Console.WriteLine($"Class description: {myWeaponAtt.Description}");
                    break;

                case "Reviewers":
                    Console.WriteLine($"Reviewers: {string.Join(", ", myWeaponAtt.Reviewers)}");
                    break;

                default:
                    break;
                }
            }
        }
Example #2
0
 public CurrentWeaponAttrChanged(Player _player_t, WeaponType _weapon_t, WeaponAttribute _weaponAttr, float _newVal)
 {
     player_t   = _player_t;
     weapon_t   = _weapon_t;
     weaponAttr = _weaponAttr;
     newVal     = _newVal;
 }
Example #3
0
    public void InsoulClick(bool levelUP = false)
    {
        var level = InsoulItem.growAttr.equipAttr.level;
        var attr  = Insoul_Info[level].exp_one;

        do
        {
            InsouTimes++;//点击的武器点击次加一
            level = InsoulItem.growAttr.equipAttr.level;
            WeaponAttribute global = ConfigManager.Get <WeaponAttribute>(InsoulItem.itemTypeId);

            InsoulGold  -= Insoul_Info[level].gold;
            InsoulStone -= Insoul_Info[level].lingshi;
            attr         = Insoul_Info[level].exp_one;

            InsoulItem.growAttr.equipAttr.expr += (uint)Insoul_Info[level].exp_one;
        }while (levelUP && InsoulItem.growAttr.equipAttr.expr < Insoul_Info[level].exp);

        if (InsoulItem.growAttr.equipAttr.expr >= Insoul_Info[level].exp)
        {
            SendMarge(InsoulItem.itemId);

            InsoulItem.growAttr.equipAttr.expr -= (uint)Insoul_Info[level].exp;
            InsoulItem.growAttr.equipAttr.level++;
            DispatchModuleEvent(EventForingMargeUpAudio);
        }
        else
        {
            DispatchModuleEvent(EventForingInsoulAudio);
        }

        DispatchModuleEvent(EventForingInSoul, attr);
        GlodChange();
    }
Example #4
0
    private void SetInsoulInfo()//设置入魂的信息
    {
        //武器的id
        if (item == null)
        {
            return;
        }
        WeaponAttribute dInfo = ConfigManager.Get <WeaponAttribute>(item.itemTypeId);

        if (dInfo == null)
        {
            return;
        }

        //元素小图
        AtlasHelper.SetShared(elementicongroup, m_elementData[(int)(dInfo.elementType) - 1]);
        AtlasHelper.SetShared(m_fill.gameObject, m_elementFill[(int)(dInfo.elementType) - 1]);
        AtlasHelper.SetShared(m_fillelement, m_elementIcon[(int)(dInfo.elementType) - 1]);

        PropItemInfo elementInfo = ConfigManager.Get <PropItemInfo>(dInfo.elementId);

        AtlasHelper.SetItemIcon(elementdebris, elementInfo);

        m_eleMaxYes.gameObject.SetActive(false);
        elementMax.anchoredPosition = new Vector3(0, 30, 0);
        ElementNext();
        Element_up();
    }
Example #5
0
    private void SetJumpInfo()
    {
        WeaponAttribute DeInfos = ConfigManager.Get <WeaponAttribute>(m_item.itemTypeId);

        if (DeInfos == null)
        {
            return;
        }
        PropItemInfo debrInfos = ConfigManager.Get <PropItemInfo>(DeInfos.debrisId);// 武器碎片信息

        if (debrInfos == null)
        {
            return;
        }
        var need = 0;

        if (m_item.growAttr.equipAttr.star - 1 >= DeInfos.quality.Length || m_item.growAttr.equipAttr.star == 0)
        {
            Logger.LogDetail("this star is error");
            return;
        }
        if (DeInfos.quality[m_item.growAttr.equipAttr.star - 1] != null)
        {
            need = DeInfos.quality[m_item.growAttr.equipAttr.star - 1].debrisNum;
        }
        moduleGlobal.SetTargetMatrial(debrInfos.ID, need);
    }
Example #6
0
 public EnchantContext(Mobile owner, WeaponAttribute attribute, bool spellChanneling, Timer timer)
 {
     m_Owner           = owner;
     m_Attribute       = attribute;
     m_SpellChanneling = spellChanneling;
     m_Timer           = timer;
 }
Example #7
0
 public EnchantContext( Mobile owner, WeaponAttribute attribute, bool spellChanneling, Timer timer )
 {
     m_Owner = owner;
     m_Attribute = attribute;
     m_SpellChanneling = spellChanneling;
     m_Timer = timer;
 }
    bool ListenerProcess(string name, WeaponAttribute attribute)
    {
        var state = attribute.states[name];

        if (!state._active)
        {
            if (state.Listener())
            {
                if (attribute.statesLayer[name] == attribute.statesLayer[attribute.runningState])
                {
                    // exit last state
                    var lastState = attribute.states[attribute.runningState];
                    if (lastState._active)
                    {
                        lastState.Exit();
                    }
                }
                attribute.lastState    = state._name.Equals(attribute.runningState) ? attribute.lastState : attribute.runningState;
                attribute.runningState = state._name;
                state.Enter();
                return(true);
            }
        }

        return(false);
    }
Example #9
0
    private void SetEnterState()
    {
        Util.SetText(roleName, modulePlayer.roleInfo.roleName);
        Util.SetText(m_Lv, modulePlayer.roleInfo.level.ToString());
        SetPotentialText(modulePlayer.roleInfo.attrPoint);

        I_Hidden(modulePlayer.roleInfo.attrPoint > 0);
        lvFillAmount.fillAmount = modulePlayer.GetExpBarProgress();

        int point = modulePlayer.roleInfo.level * 3 - 3;

        m_ResetAllBtn.SafeSetActive(totalPoint != point);
        expUpBtn.SafeSetActive(modulePlayer.isHaveExpCard);

        var prop = ConfigManager.Get <PropItemInfo>(moduleEquip.weaponItemID);

        weaponRate = prop != null ? prop.powerCovertRate : 0;

        weaponAddition = 0;
        weaponType     = 0;
        WeaponAttribute info = ConfigManager.Get <WeaponAttribute>(moduleEquip.weapon.itemTypeId);

        if (info != null)
        {
            int index = moduleEquip.weapon.growAttr != null && moduleEquip.weapon.growAttr.equipAttr != null ? moduleEquip.weapon.growAttr.equipAttr.star - 1 : 0;
            if (index < 0 || info.quality == null || index >= info.quality?.Length || info.quality[index].attributes == null || info.quality[index].attributes?.Length <= 0)
            {
                //Logger.LogError("config is error");
                return;
            }
            weaponAddition = info.quality != null && info.quality.Length > index + 1 ? info.quality[index].attributes[0].value : 0;
            weaponType     = info.quality[index].attributes[0].type;
        }
    }
Example #10
0
 public Weapon(WeaponType type, WeaponAttribute attribute)
 {
     weapon         = type;
     this.attribute = attribute;
     name           = attribute.ToString() + " " + weapon.ToString();
     setWeaponRoll();
 }
        public override void Execute()
        {
            Assembly        assembly = Assembly.GetExecutingAssembly();
            Type            type     = assembly.GetTypes().First(a => a.CustomAttributes.Any(n => n.AttributeType == typeof(WeaponAttribute)));
            WeaponAttribute attrs    = type.GetCustomAttribute <WeaponAttribute>(false);

            Console.WriteLine($"{this.Data[0]}: {attrs.Author}");
        }
Example #12
0
 public override void Init(GameObject obj)
 {
     _velocity        = obj.GetComponent <C_Velocity>();
     _iKManager       = obj.GetComponent <C_IKManager>();
     _weaponHandle    = obj.GetComponent <C_WeaponHandle>();
     _weaponAttribute = GetComponent <WeaponAttribute>();
     _photonView      = obj.GetComponent <PhotonView>();
 }
 public CommandDispatcher()
 {
     this.outHandler      = new OutputHandler();
     this.weapons         = new List <IWeapon>();
     this.inHandler       = new InputHandler();
     this.weaponFactory   = new WeaponFactory();
     this.gemFactory      = new GemFactory();
     this.weaponAttribute = (WeaponAttribute)typeof(Weapon).GetCustomAttributes(true).First();
 }
Example #14
0
        public EnchantContext( GenericReader reader, BaseWeapon weapon )
        {
            m_Owner = reader.ReadMobile();
            m_Attribute = (WeaponAttribute) reader.ReadInt();
            m_SpellChanneling = reader.ReadBool();
            m_Timer = Timer.DelayCall( reader.ReadTimeSpan(), new TimerStateCallback<BaseWeapon>( EnchantSpell.RemoveEnchantContext ), weapon );

            weapon.EnchantContext = this;
        }
Example #15
0
        public EnchantContext(GenericReader reader, BaseWeapon weapon)
        {
            m_Owner           = reader.ReadMobile();
            m_Attribute       = (WeaponAttribute)reader.ReadInt();
            m_SpellChanneling = reader.ReadBool();
            m_Timer           = Timer.DelayCall(reader.ReadTimeSpan(), new TimerStateCallback <BaseWeapon>(EnchantSpell.RemoveEnchantContext), weapon);

            weapon.EnchantContext = this;
        }
Example #16
0
    private void Element_up()//这里的 level是合魂的等级而不是武器当前的等级
    {
        var level = item.growAttr.equipAttr.level;
        var exp   = item.growAttr.equipAttr.expr;

        WeaponAttribute dInfo = ConfigManager.Get <WeaponAttribute>(item.itemTypeId);

        if (dInfo == null)
        {
            return;
        }

        if (moduleForging.Insoul_Info[level] == null)
        {
            Logger.LogError("weapon marge level is error{0}", level);
            return;
        }
        var str = moduleForging.Insoul_Info[level].lingshi.ToString() + string.Format(ConfigText.GetDefalutString(224, 50), moduleForging.InsoulStone);

        Util.SetText(elementdebris_num, str);

        gold_num.text = moduleForging.Insoul_Info[level].gold.ToString();

        if (level < moduleForging.Insoul_Info.Count - 1)
        {
            elementNormal.gameObject.SetActive(true);
            elementFenzi.text = exp.ToString();
            elementFenmu.text = moduleForging.Insoul_Info[level].exp.ToString();
            Expend_plane.gameObject.SetActive(true);
            m_maxTipTxt.gameObject.SetActive(false);
            Updata_plane.gameObject.SetActive(true);

            int now  = moduleForging.Insoul_Info[level].attribute;
            int next = moduleForging.Insoul_Info[level + 1].attribute;

            Util.SetText(margeLevelnum, ConfigText.GetDefalutString(224, 40), (next - now).ToString());//属性值

            if (Util.Parse <int>(elementFenmu.text) != 0)
            {
                m_fill.fillAmount = (float)Util.Parse <int>(elementFenzi.text) / (float)Util.Parse <int>(elementFenmu.text);
            }
        }
        else
        {
            elementNormal.gameObject.SetActive(false);
            elementMax.anchoredPosition = new Vector3(120, 30, 0);
            Updata_plane.gameObject.SetActive(false);
            Expend_plane.gameObject.SetActive(false);
            m_maxTipTxt.gameObject.SetActive(true);
            elementMax.gameObject.SetActive(true);
            m_eleMaxYes.gameObject.SetActive(true);
            m_fill.fillAmount = 1;
        }
        m_showEffect.anchoredPosition = new Vector3(0, m_fill.fillAmount * 205, 0);
        SetColor();
    }
Example #17
0
    public void GetInSoulStone(PItem item)
    {
        WeaponAttribute dInfo = ConfigManager.Get <WeaponAttribute>(item.itemTypeId);

        if (dInfo == null)
        {
            return;
        }
        InsoulStone = moduleCangku.GetItemCount(dInfo.elementId);
    }
Example #18
0
    public override void Init(GameObject obj)
    {
        _velocity     = obj.GetComponent <C_Velocity>();
        _iKManager    = obj.GetComponent <C_IKManager>();
        _weaponHandle = obj.GetComponent <C_WeaponHandle>();
        _camera       = obj.GetComponent <C_Camera>();
        _uiMgr        = obj.GetComponent <C_UiEventMgr>();

        _weaponAttribute = GetComponent <WeaponAttribute>();
    }
 bool ListenerProcess(List <string> nameList, WeaponAttribute attribute)
 {
     foreach (string name in nameList)
     {
         if (ListenerProcess(name, attribute))
         {
             return(true);
         }
     }
     return(false);
 }
Example #20
0
 public int this[WeaponAttribute attribute]
 {
     get
     {
         return(GetValue((int)attribute));
     }
     set
     {
         SetValue((int)attribute, value);
     }
 }
Example #21
0
    public bool CanUpgradeWeapon(WeaponType weapon_t, WeaponAttribute attr)
    {
        WeaponController weapon = GetWeapon(weapon_t);
        int upgradePrice        = weapon.GetUpgradePrice(attr);

        if (upgradePrice >= 0 && coins >= upgradePrice)
        {
            return(true);
        }
        return(false);
    }
Example #22
0
        public override string Execute()
        {
            var field = this.data[0];

            var             weaponAtr    = typeof(Weapon).GetCustomAttributes(false).FirstOrDefault();
            WeaponAttribute fieldToPrint = (WeaponAttribute)weaponAtr;

            var result = fieldToPrint.PrintInfo(field);

            return(result);
        }
Example #23
0
 // Use this for initialization
 void Awake()
 {
     velocity = GetComponentInParent <C_Velocity>();
     if (!velocity.isLocalPlayer)
     {
         this.enabled = false;
         return;
     }
     uiMgr                  = GetComponentInParent <C_UiEventMgr>();
     weaponAttribute        = GetComponent <WeaponAttribute>();
     weaponAttribute.OnFire = Reset;
 }
Example #24
0
    public override void Init(GameObject obj)
    {
        _animator     = obj.GetComponent <C_Animator>();
        _velocity     = obj.GetComponent <C_Velocity>();
        _iKManager    = obj.GetComponent <C_IKManager>();
        _weaponHandle = obj.GetComponent <C_WeaponHandle>();
        _uiMgr        = obj.GetComponent <C_UiEventMgr>();
        _photonView   = obj.GetComponent <PhotonView>();

        _audioSource     = GetComponent <AudioSource>();
        _weaponAttribute = GetComponent <WeaponAttribute>();
    }
Example #25
0
    public bool UpgradeWeapon(WeaponType weapon_t, WeaponAttribute attr)
    {
        WeaponController weapon = GetWeapon(weapon_t);
        int upgradePrice        = weapon.GetUpgradePrice(attr);

        if (weapon.Upgrade(attr))
        {
            coins -= upgradePrice;
            return(true);
        }
        return(false);
    }
Example #26
0
 // Use this for initialization
 void Awake()
 {
     velocity = GetComponentInParent <C_Velocity>();
     if (!velocity.isLocalPlayer)
     {
         this.enabled = false;
         return;
     }
     myCamera        = GetComponentInParent <C_Camera>();
     weaponAttribute = GetComponent <WeaponAttribute>();
     occlusionPoint  = GetComponentInParent <C_WeaponHandle>().OcclusionPoint;
     uiMgr           = GetComponentInParent <C_UiEventMgr>();
 }
 public int GetUpgradePrice(WeaponAttribute attr)
 {
     if (attr == WeaponAttribute.Attack && attackLevel != GlobalVars.maxWeaponLevel)
     {
         return(GlobalVars.WEAPON_LEVEL_UPGRADE_PRICES_ATTACK[attackLevel]);
     }
     if (attr == WeaponAttribute.Defense && defenseLevel != GlobalVars.maxWeaponLevel)
     {
         return(GlobalVars.WEAPON_LEVEL_UPGRADE_PRICES_DEFENSE[defenseLevel]);
     }
     //Can't upgrade
     return(-1);
 }
Example #28
0
    public void SetInfo(PropItemInfo Info, string weaponAttack, string eleAttck, string weaLevel, bool use)
    {
        if (Info == null)
        {
            Logger.LogError("info can not find in propitem " + Info.ID);
            return;
        }
        WeaponAttribute dInfo = ConfigManager.Get <WeaponAttribute>(Info.ID);

        Util.SetText(EleType, Show(dInfo.elementType));
        for (int i = 0; i < IConType.Count; i++)
        {
            IConType[i].gameObject.SetActive(false);
            if (i == (Info.subType - 1))
            {
                IConType[i].gameObject.SetActive(true);
            }
        }

        //拥有该武器
        m_id.text = Info.ID.ToString();

        PropItemInfo prpos = ConfigManager.Get <PropItemInfo>(Info.ID);

        if (prpos.mesh.Length <= 0)
        {
            Logger.LogError("can not find mesh name " + Info.ID);
            return;
        }
        string iconname = prpos.mesh[0];

        UIDynamicImage.LoadImage(Weapon_icon.transform, iconname, (d, t) => { Weapon_icon.gameObject.SetActive(true); }, false);

        Weaponname.text = Info.itemName;
        attacknum.text  = weaponAttack;
        elementnum.text = eleAttck;
        string format = weaLevel + Foring_Text[23];

        Util.SetText(WeaponLevel, format);

        Hight_back.gameObject.SetActive(false);
        Gary.gameObject.SetActive(true);
        if (use)
        {
            Gary.gameObject.SetActive(false);
            Hight_back.gameObject.SetActive(true);
        }

        Btn.onClick.RemoveListener(ObjClick);
        Btn.onClick.AddListener(ObjClick);
    }
Example #29
0
    void _ME(ModuleEvent <Module_Player> e)
    {
        if (e.moduleEvent == Module_Player.EventCurrencyChanged)
        {
            WeaponAttribute dInfo = ConfigManager.Get <WeaponAttribute>(item.itemTypeId);
            if (dInfo == null)
            {
                return;
            }

            SetColor();
            moduleForging.GlodChange();
        }
    }
        static void Main()
        {
            var input = Console.ReadLine();

            var             testAttribute = typeof(Weapon);
            var             atr           = testAttribute.GetCustomAttributes(false).FirstOrDefault();
            WeaponAttribute a             = (WeaponAttribute)atr;

            while (input != "END")
            {
                Console.WriteLine(a.PrintInfo(input));

                input = Console.ReadLine();
            }
        }
Example #31
0
    public override void Init(GameObject obj)
    {
        _uiMgr        = obj.GetComponent <C_UiEventMgr>();
        _camera       = obj.GetComponent <C_Camera>();
        _velocity     = obj.GetComponent <C_Velocity>();
        _iKManager    = obj.GetComponent <C_IKManager>();
        _photonView   = obj.GetComponent <PhotonView>();
        _attributes   = obj.GetComponent <C_Attributes>();
        _weaponHandle = obj.GetComponent <C_WeaponHandle>();
        _battleMgr    = obj.GetComponent <C_BattleMgr>();

        _audio           = GetComponent <AudioSource>();
        _weaponAttribute = GetComponent <WeaponAttribute>();

        timer = new Timer();
    }
Example #32
0
    private void SetJumpDrop()
    {
        WeaponAttribute dInfo = ConfigManager.Get <WeaponAttribute>(item.itemTypeId);

        if (dInfo == null)
        {
            return;
        }
        var level = item.growAttr.equipAttr.level;
        var need  = 0;

        if (moduleForging.Insoul_Info[level] != null)
        {
            need = moduleForging.Insoul_Info[level].lingshi;
        }
        moduleGlobal.SetTargetMatrial(dInfo.elementId, need, null, true, null, moduleForging.InsoulStone);
    }
Example #33
0
 private static void ApplyAttribute( WeaponAttributes attrs, int min, int max, WeaponAttribute attr, int low, int high, int scale )
 {
     attrs[attr] = Scale( min, max, low / scale, high / scale ) * scale;
 }
Example #34
0
 private static void ApplyAttribute( WeaponAttributes attrs, int min, int max, WeaponAttribute attr, int low, int high )
 {
     attrs[attr] = Scale( min, max, low, high );
 }
Example #35
0
 public EnchantEntry( WeaponAttribute attribute, int cliloc )
 {
     m_Attribute = attribute;
     m_Cliloc = cliloc;
 }