Beispiel #1
0
 public GameState()
 {
     Blocks = new BlockList();
     Effects = new EffectList();
     Units = new UnitList();
     Projectiles = new ProjectileList();
 }
Beispiel #2
0
    protected virtual void Dispose(bool isDisposing)
    {
        foreach (var om in GameObjectAndModelInfoList.Values)
        {
            om.Destroy();
        }
        foreach (var go in StarEffectList)
        {
            Object.Destroy(go);
        }
        foreach (var go in EffectList)
        {
            Object.Destroy(go);
        }
        BoneTrans.Clear();
        GameObjectAndModelInfoList.Clear();
        StarEffectList.Clear();
        EffectList.Clear();

        BoneTrans = null;
        GameObjectAndModelInfoList = null;
        StarEffectList             = null;
        EffectList     = null;
        BaseRoleConfig = null;
        LoadingEffect  = null;
        RoleObject     = null;

        DestroyGameObject();
    }
Beispiel #3
0
        private static IEnumerator DropNow(Ragdoll ragdoll, ZNetView nview, EffectList removeEffect)
        {
            if (dropDelay.Value < 0)
            {
                context.StartCoroutine(DestroyNow(ragdoll, nview, removeEffect));
                yield break;
            }

            Dbgl($"delaying dropping loot");
            yield return(new WaitForSeconds(dropDelay.Value));

            if (!modEnabled.Value)
            {
                yield break;
            }

            if (!nview.IsValid() || !nview.IsOwner())
            {
                context.StartCoroutine(DropNow(ragdoll, nview, removeEffect));
                yield break;
            }
            Dbgl($"dropping loot");
            Vector3 averageBodyPosition = ragdoll.GetAverageBodyPosition();

            Traverse.Create(ragdoll).Method("SpawnLoot", new object[] { averageBodyPosition }).GetValue();
            context.StartCoroutine(DestroyNow(ragdoll, nview, removeEffect));
        }
Beispiel #4
0
 protected override void setFieldWithElementValues()
 {
     if (element != null)
     {
         Item item = element.databaseModelToItem(resourcesList);
         databaseID       = item.databaseID;
         itemName         = item.name;
         itemIcon         = item.itemIcon;
         itemModel        = item.itemModel;
         isConsomable     = item.isConsomable;
         isStackable      = item.isStackable;
         canBeRecycle     = item.canBeRecycle;
         maxStackableSize = item.maxStackableSize;
         interactableType = item.interactibleType;
         itemType         = item.itemType;
         targetType       = item.targetType;
         numberOfEffect   = item.effects.Count;
         effects          = item.effects;
         effectsIndex.updateSize(effects.Count);
         for (int i = 0; i < effects.Count; i++)
         {
             effectsIndex[i] = EffectList.getIndexfor(effects[i].effect.getName());
         }
     }
 }
Beispiel #5
0
 void removeObject()
 {
     EnemyList.RemoveAll(checkExist);
     ItemList.RemoveAll(checkExist);
     TamaList.RemoveAll(checkExist);
     EffectList.RemoveAll(checkExist);
 }
Beispiel #6
0
        /// <summary>
        /// Toggle taunt mode on/off.
        /// </summary>
        private void ToggleTauntMode()
        {
            TauntEffect tauntEffect = EffectList.GetOfType <TauntEffect>();
            GamePlayer  owner       = (Brain as IControlledBrain).Owner as GamePlayer;

            if (tauntEffect != null)
            {
                // It's on, so let's switch it off.

                tauntEffect.Stop();
                if (owner != null)
                {
                    owner.Out.SendMessage(String.Format("{0} seems to be less aggressive than before.",
                                                        GetName(0, true)), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                }
            }
            else
            {
                // It's off, so let's turn it on.

                if (owner != null)
                {
                    owner.Out.SendMessage(String.Format("{0} enters an aggressive stance.",
                                                        GetName(0, true)), eChatType.CT_System, eChatLoc.CL_SystemWindow);
                }

                new TauntEffect().Start(this);
            }
        }
    public void SetEffect(EffectList effect, float deactivationTime = 0)
    {
        // if should change to old effect stop it
        if (effectStopCoroutine != null)
        {
            CameraEffect = mainEffect;
            StopCoroutine(effectStopCoroutine);
            effectStopCoroutine = null;
        }

        //if effect not temp
        if (deactivationTime > 0)
        {
            effectStopCoroutine = StartCoroutine(this.DoWithDelayCoroutine(() =>
            {
                CameraEffect        = mainEffect;
                effectStopCoroutine = null;
            }, deactivationTime));
        }
        else
        {
            mainEffect = effect;
        }
        CameraEffect = effect;
    }
Beispiel #8
0
        /// <summary>
        /// 销毁Effect
        /// </summary>
        /// <returns></returns>
        private IEnumerator AsyncDestroyEffects()
        {
            while (true)
            {
                yield return(null);

                if (m_destroyingEffectList.Count > 0)
                {
                    EffectList effectList = m_destroyingEffectList.Dequeue();

                    while (effectList.IsLoading)
                    {
                        yield return(null);
                    }

                    while (effectList.EffectPack.IsFadeOut && (m_fadeTime > (Time.timeSinceLevelLoad - effectList.DestroyTime)))
                    {
                        yield return(null);
                    }

                    for (int i = 0; i < effectList.Effects.Count; ++i)
                    {
                        DestroyEffect(effectList.Effects[i]);
                    }
                }
            }
        }
Beispiel #9
0
        /// <summary>
        /// 预加载EffectPack
        /// </summary>
        /// <param name="effectPack">要加载的EffectPack</param>
        /// <returns>EffectPack对应的EffectList</returns>
        public EffectList PreLoadEffects(EffectPack effectPack)
        {
            EffectList effectList = new EffectList(effectPack);

            m_loadingEffectList.Enqueue(effectList);
            return(effectList);
        }
Beispiel #10
0
        public void SetRunProperties(RunProperties runProperties,
                                     DocumentFormat.OpenXml.Presentation.Shape shape,
                                     ref LinkedList <string> effectShapes)
        {
            if (runProperties != null)
            {
                EffectList   effects  = runProperties.GetFirstChild <EffectList>();
                GradientFill gradient = runProperties.GetFirstChild <GradientFill>();

                if ((shape.TextBody.BodyProperties != null && shape.TextBody.BodyProperties.FromWordArt != null && shape.TextBody.BodyProperties.FromWordArt) ||
                    (effects != null && effects.HasChildren) ||
                    (gradient != null && gradient.HasChildren))
                {
                    UInt32Value id = shape.NonVisualShapeProperties.NonVisualDrawingProperties.Id;
                    effectShapes.AddLast(slide.slideIndex + "_" + id.Value);
                }


                //get the text color.
                var solidFill = runProperties.GetFirstChild <SolidFill>();
                if (solidFill != null)
                {
                    this.ReadSolidFillColors(solidFill);
                }
                if (runProperties.FontSize != null)
                {
                    FontSize = runProperties.FontSize / Globals.FontPoint;
                }
                if (runProperties.Bold != null)
                {
                    Bold = runProperties.Bold;
                }

                if (runProperties.Italic != null)
                {
                    Italic = runProperties.Italic;
                }
                if (runProperties.Underline != null)
                {
                    Underline = runProperties.Underline.Value.ToString();
                }
                if (runProperties.Spacing != null)
                {
                    Spacing = runProperties.Spacing.Value;
                }

                var latinFonts        = runProperties.GetFirstChild <LatinFont>();
                var coplexScriptFonts = runProperties.Descendants <ComplexScriptFont>();

                if (latinFonts != null)
                {
                    this.ReadFontFamilyFromTheme(latinFonts);
                }
                else if (coplexScriptFonts.GetEnumerator().Current != null)
                {
                    FontFamily = coplexScriptFonts.GetEnumerator().Current.Typeface;
                }
            }
        }
Beispiel #11
0
 public static void Prefix(Attack __instance, ref EffectList __state)
 {
     if (__instance.m_weapon.IsMagic() && __instance.m_weapon.GetMagicItem().HasEffect(MagicEffectType.Throwable))
     {
         __state = __instance.m_weapon.m_shared.m_triggerEffect;
         __instance.m_weapon.m_shared.m_triggerEffect = new EffectList();
     }
 }
Beispiel #12
0
 static void Postfix(Ragdoll __instance, ZNetView ___m_nview, EffectList ___m_removeEffect)
 {
     if (!ZNetScene.instance)
     {
         return;
     }
     Dbgl($"Changing death time from {__instance.m_ttl} to {destroyDelay.Value}, drop time from {__instance.m_ttl} to {dropDelay.Value}");
     context.StartCoroutine(DropNow(__instance, ___m_nview, ___m_removeEffect));
 }
Beispiel #13
0
        public override void Setup(Character character)
        {
            var vfxWet = Prefab.Cache.GetPrefab <GameObject>("vfx_Wet");

            m_startEffects = new EffectList();
            m_startEffects.m_effectPrefabs = new EffectList.EffectData[] { Utility.Utilities.WetEffect };

            base.Setup(character);
        }
Beispiel #14
0
 public override void Setup(Character character)
 {
     if ((bool)balance["enableMarkedForDeathFX"])
     {
         m_startEffects = new EffectList();
         m_startEffects.m_effectPrefabs = new EffectList.EffectData[] { Data.VFXMarkedForDeath };
     }
     base.Setup(character);
 }
Beispiel #15
0
    private void btnReadFile_Click(object sender, System.EventArgs e)
    {
        //-----------------------------------------------------------------------------
        // Name: OnReadFile()
        // Desc: Reads a file contain a collection of DirectInput force feedback
        //       effects.  It creates each of effect read in and stores it
        //       in the linked list, g_EffectsList.
        //-----------------------------------------------------------------------------

        OpenFileDialog ofd     = new OpenFileDialog();
        EffectList     effects = null;

        if (strPath == string.Empty)
        {
            strPath = DXUtil.SdkMediaPath;
        }

        // Setup the OpenFileDialog structure.
        ofd.Filter           = "FEdit Files|*.ffe|All Files|*.*";
        ofd.InitialDirectory = strPath;
        ofd.Title            = "Open FEdit File";
        ofd.ShowReadOnly     = false;

        // Display the OpenFileName dialog. Then, try to load the specified file.
        if (DialogResult.Cancel == ofd.ShowDialog())
        {
            return;
        }

        // Store the path.
        strPath = Path.GetDirectoryName(ofd.FileName);

        // Get the effects in the file selected.
        effects = applicationDevice.GetEffects(ofd.FileName, FileEffectsFlags.ModifyIfNeeded);

        EmptyEffectList();

        foreach (FileEffect f in effects)
        {
            EffectObject eo = new EffectObject(f.EffectGuid, f.EffectStruct, applicationDevice);
            applicationEffects.Add(eo);
        }

        // If list of effects is empty, then there are no effects created.
        if (0 == applicationEffects.Count)
        {
            // Pop up a box informing the user.
            MessageBox.Show("Unable to create any effects.");
            btnPlayEffects.Enabled = false;
        }
        else
        {
            // There are effects, so enable the 'play effects' button.
            btnPlayEffects.Enabled = true;
        }
    }
        // This is an exact copy of the ingame method "UseItem" to provide a reliable way of controlling it later
        static bool Prefix(Humanoid __instance, Inventory inventory, ItemDrop.ItemData item, bool fromInventoryGui,
                           Inventory ___m_inventory, EffectList ___m_consumeItemEffects, ZSyncAnimation ___m_zanim)
        {
            if (inventory == null)
            {
                inventory = ___m_inventory;
            }
            if (!inventory.ContainsItem(item))
            {
                return(false);
            }
            var hoverObject = __instance.GetHoverObject();
            var hoverable   = (hoverObject ? hoverObject.GetComponentInParent <Hoverable>() : null);

            if (hoverable != null && !fromInventoryGui)
            {
                var componentInParent = hoverObject.GetComponentInParent <Interactable>();
                if (componentInParent != null && componentInParent.UseItem(__instance, item))
                {
                    return(false);
                }
            }
            if (item.m_shared.m_itemType == ItemDrop.ItemData.ItemType.Consumable)
            {
                if (__instance.ConsumeItem(inventory, item))
                {
                    ___m_consumeItemEffects.Create(Player.m_localPlayer.transform.position, Quaternion.identity);
                    ___m_zanim.SetTrigger("eat");
                }
                else
                {
                    return(false);
                }
            }
            else if ((inventory != ___m_inventory ||
                      !(bool)_toggleEquiped.Invoke(__instance, new [] { item })) && !fromInventoryGui)
            {
                if (hoverable != null)
                {
                    // FIXME Fix localization
                    __instance.Message(MessageHud.MessageType.Center, "$msg_cantuseon");
//                    __instance.Message(MessageHud.MessageType.Center, Localization.instance.Localize("$msg_cantuseon", item.m_shared.m_name, hoverable.GetHoverName()));
                }
                else
                {
                    // FIXME Fix localization
                    __instance.Message(MessageHud.MessageType.Center, "$msg_useonwhat");
//                    __instance.Message(MessageHud.MessageType.Center, Localization.instance.Localize("$msg_useonwhat", item.m_shared.m_name));
                }

                return(false);
            }

            Longship.Instance.EventManager.DispatchEvent(new HumanoidUseItemEvent(__instance, inventory, item));
            return(false);
        }
Beispiel #17
0
        public override void Setup(Character character)
        {
            m_ttl = -1;

            m_icon         = Utility.Utilities.SweatSprite;
            m_startEffects = new EffectList();
            m_startEffects.m_effectPrefabs = new EffectList.EffectData[] { Utility.Utilities.WetEffect };

            base.Setup(character);
        }
Beispiel #18
0
 private void OnEnable()
 {
     if (m_effectList == null)
     {
         if (m_effectPack)
         {
             m_effectList = App.EffectManager.PreLoadEffects(m_effectPack);
         }
     }
 }
        // This is an exact copy of the ingame method "DropItem" to provide a reliable way of controlling it later
        static bool Prefix(Humanoid __instance, ref bool __result, Inventory inventory, ItemDrop.ItemData item,
                           int amount, ItemDrop.ItemData ___m_hiddenLeftItem, ItemDrop.ItemData ___m_hiddenRightItem,
                           ZSyncAnimation ___m_zanim, EffectList ___m_dropEffects, VisEquipment ___m_visEquipment)
        {
            if (item.m_shared.m_questItem)
            {
                __instance.Message(MessageHud.MessageType.Center, "$msg_cantdrop");
                __result = false;
                return(false);
            }
            __instance.RemoveFromEquipQueue(item);
            __instance.UnequipItem(item, triggerEquipEffects: false);
            if (___m_hiddenLeftItem == item)
            {
                ___m_hiddenLeftItem = null;
                _setupVisEquipment.Invoke(__instance, new [] { ___m_visEquipment, (object)false });
            }
            if (___m_hiddenRightItem == item)
            {
                ___m_hiddenRightItem = null;
                _setupVisEquipment.Invoke(__instance, new [] { ___m_visEquipment, (object)false });
            }
            if (amount == item.m_stack)
            {
//                ZLog.Log("drop all " + amount + "  " + item.m_stack);
                if (!inventory.RemoveItem(item))
                {
//                    ZLog.Log("Was not removed");
                    __result = false;
                    return(false);
                }
            }
            else
            {
//                ZLog.Log("drop some " + amount + "  " + item.m_stack);
                inventory.RemoveItem(item, amount);
            }
            ItemDrop itemDrop = ItemDrop.DropItem(item, amount, __instance.transform.position +
                                                  __instance.transform.forward + __instance.transform.up,
                                                  __instance.transform.rotation);

            Longship.Instance.EventManager.DispatchEvent(new HumanoidDropItemEvent(__instance, item, amount));
            if (__instance.IsPlayer())
            {
                itemDrop.OnPlayerDrop();
            }
            itemDrop.GetComponent <Rigidbody>().velocity = (__instance.transform.forward + Vector3.up) * 5f;
            ___m_zanim.SetTrigger("interact");
            ___m_dropEffects.Create(__instance.transform.position, Quaternion.identity);
            __instance.Message(MessageHud.MessageType.TopLeft, "$msg_dropped " +
                               itemDrop.m_itemData.m_shared.m_name,
                               itemDrop.m_itemData.m_stack, itemDrop.m_itemData.GetIcon());
            __result = true;
            return(false);
        }
Beispiel #20
0
 public static void UpdateEffects()
 {
     for (int i = 0; i < EffectList.Count; i++)
     {
         if (!EffectList[i].Update())
         {
             EffectList.RemoveAt(i);
             i--;
         }
     }
 }
Beispiel #21
0
        private static void PlayEffects()
        {
            EffectList effects = new EffectList();
            List <EffectList.EffectData> effectList = new List <EffectList.EffectData>();

            for (int i = 0; i < Player.m_localPlayer.m_deathEffects.m_effectPrefabs.Length; i++)
            {
                effectList.Add(Player.m_localPlayer.m_deathEffects.m_effectPrefabs[i]);
            }
            effects.m_effectPrefabs = effectList.ToArray();
            effects.Create(Player.m_localPlayer.transform.position, Player.m_localPlayer.transform.rotation, Player.m_localPlayer.transform, 1f);
        }
        public bool InitializeInput()
        {
            // Create our joystick device
            foreach (DeviceInstance di in Manager.GetDevices(DeviceClass.GameControl,
                                                             EnumDevicesFlags.AttachedOnly | EnumDevicesFlags.ForceFeeback))
            {
                // Pick the first attached joystick we see
                device = new Device(di.InstanceGuid);
                break;
            }
            if (device == null)             // We couldn't find a joystick
            {
                return(false);
            }

            device.SetDataFormat(DeviceDataFormat.Joystick);
            device.SetCooperativeLevel(this, CooperativeLevelFlags.Exclusive | CooperativeLevelFlags.Background);
            device.Properties.AxisModeAbsolute = true;
            device.Properties.AutoCenter       = false;
            device.Acquire();

            // Enumerate any axes
            foreach (DeviceObjectInstance doi in device.Objects)
            {
                if ((doi.ObjectId & (int)DeviceObjectTypeFlags.Axis) != 0)
                {
                    // We found an axis, set the range to a max of 10,000
                    device.Properties.SetRange(ParameterHow.ById,
                                               doi.ObjectId, new InputRange(-5000, 5000));
                }
            }

            // Load our feedback file
            EffectList effects = null;

            effects = device.GetEffects(@"C:\MyEffectFile.ffe",
                                        FileEffectsFlags.ModifyIfNeeded);
            foreach (FileEffect fe in effects)
            {
                EffectObject myEffect = new EffectObject(fe.EffectGuid, fe.EffectStruct,
                                                         device);
                myEffect.Download();
                effectList.Add(myEffect);
            }

            while (running)
            {
                UpdateInputState();
                Application.DoEvents();
            }

            return(true);
        }
 private static void CollectEffectsFromItemDrop(EffectList list)
 {
     if (list != null && list.m_effectPrefabs.Length > 0)
     {
         foreach (EffectData ed in list.m_effectPrefabs)
         {
             if (ed.m_prefab != null && !listOfEffects.ContainsKey(ed.m_prefab.name.GetStableHashCode()))
             {
                 listOfEffects.Add(ed.m_prefab.name.GetStableHashCode(), ed.m_prefab);
             }
         }
     }
 }
Beispiel #24
0
    void PerformEffect(EffectList notesi)
    {
        if (notesi.currentIndex >= notesi.notedata.Length)
        {
            return;
        }
        if (notesi.currentIndex < 0)
        {
            ++notesi.currentIndex;
            return;
        }
        char currentnote = notesi.notedata[notesi.currentIndex];

        if (currentnote == '0')
        {
            ++notesi.currentIndex;
            return;
        }

        else
        {
            //we do an effect bois
            switch (currentnote)
            {
            case 'b':
                ChangeColor(Color.blue);
                break;

            case 'r':
                ChangeColor(Color.red);
                break;

            case 'g':
                ChangeColor(Color.green);
                break;

            case '1':
                ChangeColor(startingColor);
                break;

            case 'w':
                ChangeColor(Color.white);
                break;

            default:
                break;
            }
            Debug.Log("bopo!");
            ++notesi.currentIndex;
        }
    }
Beispiel #25
0
        /// <summary>
        /// Create necromancer pet from template. Con and hit bonuses from
        /// items the caster was wearing when the summon started, will be
        /// transferred to the pet.
        /// </summary>
        /// <param name="npcTemplate"></param>
        /// <param name="owner">Player who summoned this pet.</param>
        /// <param name="summonConBonus">Item constitution bonuses of the player.</param>
        /// <param name="summonHitsBonus">Hits bonuses of the player.</param>
        public NecromancerPet(INpcTemplate npcTemplate, int summonConBonus,
                              int summonHitsBonus) : base(npcTemplate)
        {
            // Transfer bonuses.

            m_summonConBonus  = summonConBonus;
            m_summonHitsBonus = summonHitsBonus;

            // Set immunities/load equipment/etc.

            switch (Name.ToLower())
            {
            case "lesser zombie servant":
            case "zombie servant":
                EffectList.Add(new MezzRootImmunityEffect());
                LoadEquipmentTemplate("barehand_weapon");
                InventoryItem item;
                if (Inventory != null &&
                    (item = Inventory.GetItem(eInventorySlot.RightHandWeapon)) != null)
                {
                    item.ProcSpellID = (int)Procs.Stun;
                }
                break;

            case "reanimated servant":
                LoadEquipmentTemplate("reanimated_servant");
                break;

            case "necroservant":
                LoadEquipmentTemplate("necroservant");
                break;

            case "greater necroservant":
                LoadEquipmentTemplate("barehand_weapon");
                if (Inventory != null &&
                    (item = Inventory.GetItem(eInventorySlot.RightHandWeapon)) != null)
                {
                    item.ProcSpellID = (int)Procs.Poison;
                }
                break;

            case "abomination":
                LoadEquipmentTemplate("abomination_fiery_sword");
                break;

            default:
                LoadEquipmentTemplate("barehand_weapon");
                break;
            }
        }
Beispiel #26
0
        private void UpdateConfiguration()
        {
            m_configurationPropertySet.Clear();

            if (CurrentStaticEditor != null)
            {
                m_configurationPropertySet.Add(new KeyValuePair <string, object>("Effect", CurrentStaticEditor.Effect));
            }
            else
            {
                var effectList = new EffectList(Effects.Select(evm => evm.Effect).Distinct());
                m_configurationPropertySet.Add(new KeyValuePair <string, object>("Effect", effectList));
            }
        }
Beispiel #27
0
            public SE_Light() : base()
            {
                name           = "SE_Runestones_Light";
                m_name         = "Light";
                m_tooltip      = "Stealth difficulty increased 100%";
                m_startMessage = "Let there be light";
                m_time         = 0;
                m_ttl          = baseDuration;
                m_icon         = Sprite.Create((from Texture2D s in Resources.FindObjectsOfTypeAll <Texture2D>() where s.name == "bam2" select s).FirstOrDefault(), new Rect(0, 0, 256, 256), new Vector2());

                m_startEffects = new EffectList();

                m_stealthModifier = 1f;
            }
        public List <string> LoadEffects(string fileName = @".\effects\FEdit2.ffe")
        {
            // Load our feedback file
            EffectList effects = Device.GetEffects(fileName, FileEffectsFlags.ModifyIfNeeded);

            foreach (FileEffect fe in effects)
            {
                EffectObject myEffect = new EffectObject(fe.EffectGuid, fe.EffectStruct, Device);
                myEffect.Download();
                effectList.Add(fe.Name, myEffect);
            }

            return(effectList.Keys.ToList());
        }
Beispiel #29
0
 private static void ExtractEffectsFromPiece(EffectList el)
 {
     if (el.m_effectPrefabs != null && el.m_effectPrefabs.Length > 0)
     {
         foreach (var effect in el.m_effectPrefabs)
         {
             if (effect.m_prefab != null &&
                 !MyReferences.listOfEffects.ContainsKey(effect.m_prefab.name.GetStableHashCode()))
             {
                 MyReferences.listOfEffects.Add(effect.m_prefab.name.GetStableHashCode(), effect.m_prefab);
             }
         }
     }
 }
Beispiel #30
0
        public virtual bool TakeDamage(Living source, ref int damageAmount, ref int criticalAmount, string msg)
        {
            bool result = false;

            if (IsFrost == false && m_blood > 0)
            {
                if (source != this || source.Team == this.Team)
                {
                    OnBeforeTakedDamage(source, ref damageAmount, ref criticalAmount);
                }

                m_blood -= (damageAmount + criticalAmount);

                if (EffectTrigger && this is Player)
                {
                    Game.SendMessage((this as Player).PlayerDetail, LanguageMgr.GetTranslation("PlayerEquipEffect.Success2"), LanguageMgr.GetTranslation("PlayerEquipEffect.Success3", (this as Player).PlayerDetail.PlayerCharacter.NickName), 3);
                }
                if (m_syncAtTime)
                {
                    if (this is SimpleBoss && (((SimpleBoss)this).NpcInfo.ID == 22 || ((SimpleBoss)this).NpcInfo.ID == 29))
                    {
                        m_game.SendGameUpdateHealth(this, 6, damageAmount + criticalAmount);
                    }
                    else
                    {
                        m_game.SendGameUpdateHealth(this, 1, damageAmount + criticalAmount);
                    }
                }
                OnAfterTakedDamage(source, damageAmount, criticalAmount);

                if (m_blood <= 0)
                {
                    Die();
                }
                //log.Error(string.Format("调用函数" + msg + string.Format("----玩家名称:{0},ID{1}", this.Name, Id) + string.Format("----当前血量{0}", Blood)));
                if (this is Player)
                {
                    //Console.WriteLine("伤血{0}", damageAmount + criticalAmount);
                    // Console.WriteLine("玩家{0}, 血量{1}", this.Name, Blood);
                }
                result = true;
            }

            EffectList.StopEffect(typeof(IceFronzeEffect));
            EffectList.StopEffect(typeof(HideEffect));
            EffectList.StopEffect(typeof(NoHoleEffect));

            return(result);
        }
        private void ConectarDispositivo()
        {
            var helper = new System.Windows.Interop.WindowInteropHelper(_view);

            _dispositivo = new Device(DispositivoSelecionado.Guid);

            if (_dispositivo.DeviceInformation.InstanceName.Contains("XBOX"))
            {
                _controleXbox = true;
            }

            // Set joystick axis ranges.
            var eixos = _dispositivo.GetObjects(DeviceObjectTypeFlags.Axis);

            // Configura os eixos já para o PWM
            foreach (DeviceObjectInstance doi in eixos)
            {
                InputRange inputRange = new InputRange(0, 255);

                // Eixo do volante
                if (doi.Name.Contains("Wheel axis"))
                {
                    inputRange = new InputRange(-255, 255);
                }

                if (doi.Name.Contains("X Axis") && _controleXbox)
                {
                    inputRange = new InputRange(-255, 255);
                }

                if (doi.Name.Contains("Z Axis") && _controleXbox)
                {
                    inputRange = new InputRange(-255, 255);
                }

                _dispositivo.Properties.SetRange(ParameterHow.ById, doi.ObjectId, inputRange);
            }

            _dispositivo.Properties.AxisModeAbsolute = true;

            EffectList effects = _dispositivo.GetEffects(EffectType.All);

            // _dispositivo.SetCooperativeLevel(helper.Handle, CooperativeLevelFlags.NonExclusive | CooperativeLevelFlags.Background);

            _dispositivo.SetDataFormat(DeviceDataFormat.Joystick);

            // _dispositivo.Properties.BufferSize = 128;
            _dispositivo.Acquire();
        }
Beispiel #32
0
        //-----------------------------------//
        //--------------------------------------------------------------------//
        // 2A.エフェクト:スキルエフェクト配列から名前の合致するスキルエフェクトを取得 //
        //--------------------------------------------------------------------//
        EffectList GetEffectWithName(EffectList[] actions, string name)
        {
            foreach (EffectList s in actions) {
                if (s.name.Equals(name)) {
                    return s;

                }
            }

            return new EffectList();
        }
Beispiel #33
0
        //------------------------------------------------------------------------------------------------------------------//
        ///////////////////////////////////////////
        /// 									/// 
        /// 		Effect Viewer Method		/// 
        ///										/// 
        ///////////////////////////////////////////
        ///////////////////////////
        /// 					/// 
        ///  Store Val to SOBJ	/// 
        ///						/// 
        ///////////////////////////
        //-----------------------------------------------------------//
        // GameObject eff の パラメータをScriptable Objectに保存する. //
        //-----------------------------------------------------------//
        void SaveParamToSOBJ(EffectList action , Effect e)
        {
            for (int i = 0; i < action.effects.Length; i++) {

                ////////////////
                // Model Name //
                ////////////////
                effectSequence.Model = model.name;	// string で 保存して Find.GameObjectで取得するか

                //////////////////
                // Element Name //
                //////////////////
                effectSequence.Name = effectName; //eff[i].effectName;

                ///////////////////////
                // Effect Properties //
                ///////////////////////
                // AnimClip
                effectSequence.AnimClip = action.animationClip;
                // Effect
                effectParameter[i].Effect = action.effects[i].effect;
                // Node
                effectParameter[i].Node = action.effects[i].node;
                // isGlobal
                effectParameter[i].IsGlobal = action.effects[i].isGlobal;

                ///////////////
                // Transform //
                ///////////////
                effectParameter[i].Position = action.effects[i].position;
                effectParameter[i].PositionRandom = action.effects[i].positionRandom;
                effectParameter[i].Rotation = action.effects[i].rotation;
                effectParameter[i].RotationRandom = action.effects[i].rotationRandom;
                effectParameter[i].Scale = action.effects[i].scale;
                effectParameter[i].ScaleRandom = action.effects[i].scaleRandom;
                // Particle Scale
                effectParameter[i].ParticleScale = action.effects[i].particleScale;

                ///////////////
                //   Frame   //
                ///////////////
                effectSequence.setIsLoop(i,action.effects[i].isLoop);
                effectSequence.setStartFrame(i,action.effects[i].startFrame);
                effectSequence.setEndFrame (i, action.effects [i].endFrame);

            }
        }
        private void UpdateConfiguration()
        {
            m_configurationPropertySet.Clear();

            if (CurrentStaticEditor != null)
            {
                m_configurationPropertySet.Add(new KeyValuePair<string, object>("Effect", CurrentStaticEditor.Effect));
            }
            else
            {
                var effectList = new EffectList(Effects.Select(evm => evm.Effect).Distinct());
                m_configurationPropertySet.Add(new KeyValuePair<string, object>("Effect", effectList));
            }
        }
Beispiel #35
0
        //------------------------------------------------------------------------------------------------------------------//
        //------------------------------------------------------------------------------------------------------------------//
        // endFrame ジェネリックリストの降順ソート	※ currentMaxDuration の決定用途
        //------------------------------------------------------------------------------------------------------------------//
        private void CurrentMaxDurationSort(EffectList action)
        {
            // endFrame の 値から currentMaxDuration => currentSlider の終了地点 を決定する

            int max = 0;

            foreach (Effect eff in action.effects) {

                max = Mathf.Max (max, eff.endFrame);

            }

            currentMaxDuration = max;
        }
Beispiel #36
0
 public ParticleSystem()
 {
     m_effects = new EffectList(this);
     BlendMode = BlendMode.Additive;
 }
Beispiel #37
0
        //-----------------------------------------------------------//
        ///////////////////////////
        /// 					/// 
        ///  Load Val from SOBJ	/// 
        ///						/// 
        ///////////////////////////
        //-----------------------------------------------------------//
        // GameObject eff の パラメータをScriptable Objectから読み込む. //
        //-----------------------------------------------------------//
        void LoadParamFromSOBJ(EffectList action , Effect e)
        {
            for (int i = 0; i < action.effects.Length; i++) {

                ////////////////
                // Model Name //
                ////////////////
                model.name = effectSequence.Model;

                //////////////////
                // Element Name //
                //////////////////
                effectName = effectSequence.Name;

                ///////////////////////
                // Effect Properties //
                ///////////////////////
                // AnimClip
                action.animationClip = effectSequence.AnimClip;
                // Effect
                action.effects[i].effect = effectParameter[i].Effect;
                // Node
                action.effects[i].node = effectParameter[i].Node;
                // isGlobal
                action.effects[i].isGlobal = effectParameter[i].IsGlobal;

                ///////////////
                // Transform //
                ///////////////
                action.effects[i].position = effectParameter[i].Position;
                action.effects[i].positionRandom = effectParameter[i].PositionRandom;
                action.effects[i].rotation = effectParameter[i].Rotation;
                action.effects[i].rotationRandom = effectParameter[i].RotationRandom;
                action.effects[i].scale = effectParameter[i].Scale;
                action.effects[i].scaleRandom = effectParameter[i].ScaleRandom;
                // Particle Scale
                action.effects[i].particleScale = effectParameter[i].ParticleScale;

                ///////////////
                //   Frame   //
                ///////////////
                action.effects[i].isLoop = effectSequence.getIsLoop(i);
                action.effects[i].startFrame = effectSequence.getStartFrame(i);
                action.effects[i].endFrame = effectSequence.getEndFrame (i);

            }
        }