Пример #1
0
        public void CmdUse(SyncItem syncItem)
        {
            var item = items.FirstOrDefault(x => x.GetInstanceID() == syncItem.id);

            if (item == null)
            {
                return;
            }
            var opponents = Race.GetCharactersByNetIds(syncItem.targetNetIds);

            Use(item, opponents);
        }
Пример #2
0
        public void CmdUse(SyncItem syncItem)
        {
            var skill = skills.FirstOrDefault(x => x.GetInstanceID() == syncItem.id);

            if (skill == null)
            {
                return;
            }

            var opponents = Race.GetCharactersByNetIds(syncItem.targetNetIds);

            Use(skill, opponents);

            // EXECUTE EFFECT ON CLIENT
            RpcInvokeEffect(skill.name, syncItem);
        }
Пример #3
0
        public void RpcInvokeEffect(string key, SyncItem syncItem)
        {
            if (!isClient)
            {
                return;
            }
            var effectType = skillEffects [key];

            if (effectType == null)
            {
                return;
            }
            var attacker  = Race.GetCharacterByNetId(syncItem.ownNetId, false);
            var opponents = Race.GetCharactersByNetIds(syncItem.targetNetIds, false);

            Effect.CreatePrimitiveAndUse(effectType, null, attacker, opponents);
        }