コード例 #1
0
        private void MapWithPushpins_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            // Disables the default mouse double-click action.
            e.Handled = true;

            // Determin the location to place the pushpin at on the map.

            //Get the mouse click coordinates
            var mousePosition = e.GetPosition(this);

            mousePosition.X -= myMap.Margin.Left;

            //Convert the mouse coordinates to a locatoin on the map
            var pinLocation = myMap.ViewportPointToLocation(mousePosition);

            // The pushpin to add to the map.
            Pushpin pin = new Pushpin();

            pin.Location = pinLocation;
            pushPins.Add(pin);
            Relic myStart = new Relic("Start", pin.Location.Latitude, pin.Location.Longitude);

            myTrip.Add(myStart);
            //comboBox1.Items.Add(myStart.Name);

            // Adds the pushpin to the map.
            myMap.Children.Add(pin);
        }
コード例 #2
0
        public void Equip(Relic relic, RelicSlot slot)
        {
            var previousSlot = FindContainingSlot(relic);

            if (previousSlot != null)
            {
                if (!slot.IsEmpty)
                {
                    var temp = previousSlot.Relic;
                    previousSlot.Equip(slot.Relic);
                    slot.Equip(temp);
                    return;
                }

                Unequip(relic);
            }

            if (!slot.IsEmpty)
            {
                Unequip(slot.Relic);
            }

            relic.Owner = gameObject;
            relic.Equip();

            slot.Equip(relic);

            Equipped?.Invoke(this, relic);
        }
コード例 #3
0
        public void Unlock(Relic relic)
        {
            relic.Owner = gameObject;
            Available.Add(relic);

            Unlocked?.Invoke(this, relic);
        }
コード例 #4
0
        public void Unequip(Relic relic)
        {
            relic.Unequip();
            FindContainingSlot(relic)?.Unequip();

            Unequipped?.Invoke(this, relic);
        }
コード例 #5
0
        public void Initialize(Relic relic)
        {
            Cleanup();

            Relic             = relic;
            Relic.Unequipped += OnRelicUnequipped;
            Relic.Equipped   += OnRelicEquipped;

            this.icon.gameObject.SetActive(!relic.IsEmpty);
            this.border.gameObject.SetActive(!relic.IsEmpty);

            if (!relic.IsEmpty)
            {
                this.icon.sprite  = Resources.Load <Sprite>(relic.Icon);
                this.border.color = relic.Rarity.Color();
            }

            if (Relic.IsEquipped)
            {
                OnRelicEquipped(Relic);
            }
            else
            {
                OnRelicUnequipped(Relic);
            }
        }
コード例 #6
0
        private void CreateRelic(Relic relic)
        {
            var relicView = this.relicViewPool.Spawn();

            relicView.Clicked += OnRelicViewClicked;
            relicView.Initialize(relic);
        }
コード例 #7
0
 public void OnDeactivateRelic(Transform _interactingEntity_, Relic _relic_)
 {
     if (modifiedStat.StatModifiers.Contains(_relic_.relicData.stadModifier))
     {
         modifiedStat.RemoveModifier(_relic_.statMod);
     }
 }
コード例 #8
0
    Relic relic;                //relic object associated with this relic (just contains the sprite)

    // Start is called before the first frame update
    void Start()
    {
        allRelicsObject = GameObject.FindGameObjectWithTag("AllRelics");        //find our gameobject which has a reference to all relics
        relic           = allRelicsObject.GetComponent <AllRelics>().DmgResist; // set our relic equal to the speific relic we want
        GameInformation.entities.player.GetComponent <Player>().damageResistance += relic.increaseValue;
        Inventory.instance.Add(relic);                                          // add our relic to our inventory. This also takes care of updating the sprite in the UI.
    }
コード例 #9
0
 public void OnMouseDown()
 {
     GetComponent <Collider2D>().enabled = false;
     thisRelic = RelicController.relic.GetRandomRelic();
     RewardsMenuController.rewardsMenu.ShowRelicRewardMenu(thisRelic);
     InformationLogger.infoLogger.SaveGame(true);
 }
コード例 #10
0
 public void InitializeBox(Relic relic)
 {
     description.text = relic.discoveryDescription;
     icon.sprite      = relic.icon;
     popupBox.SetActive(true);
     StartCoroutine(ClosePopup());
 }
コード例 #11
0
        public void GetIndexViewModels_Alow()
        {
            var relicPositive = new Relic()
            {
                Price     = 123,
                RelicName = "relic1"
            };
            var relicNegative = new Relic()
            {
                Price     = -10,
                RelicName = "relic2"
            };
            var relics = new List <Relic>()
            {
                relicPositive, relicNegative
            };

            _mockRepository.Setup(x => x.GetAll()).Returns(relics);

            var viewModels = _presentation.GetIndexViewModels();

            _mockRepository.Verify(x => x.GetAll(), Times.Once);

            _mockMapper.Verify(x => x.Map <RelicViewModel>(relicPositive), Times.Once);
            _mockMapper.Verify(x => x.Map <RelicViewModel>(relicNegative), Times.Never);

            Assert.AreEqual(1, viewModels.Count);
        }
コード例 #12
0
    public void OnActivateRelic(Transform _interactingEntity_, Relic _relic_)
    {
        _characterStats = _interactingEntity_.GetComponent <CharacterStats>();

        // If the modified Stat is a health stat...
        if (_relic_.relicData.statType == StatType.Health)
        {
            // If the affected entity's current health is at max health...
            if (_characterStats.GetNormalizedHealth() == 1)
            {
                DetermineStat(_characterStats, _relic_.relicData.statType).AddModifer(_relic_.statMod);
                _characterStats.SetHealth(_characterStats.health_Stat.value);
            }
            else
            {
                var currentHealthPerc = _characterStats.GetNormalizedHealth();
                var currentHealth     = _characterStats.GetCurrentHealth();

                var adjustedModValue = currentHealthPerc * _relic_.statMod.value;

                DetermineStat(_characterStats, _relic_.relicData.statType).AddModifer(_relic_.statMod);
                _characterStats.SetHealth(currentHealth += adjustedModValue);
            }

            modifiedStat = DetermineStat(_characterStats, _relic_.relicData.statType);
            return;
        }

        // Determines the Stat to be affected and adds the Relics stat modifier
        DetermineStat(_characterStats, _relic_.relicData.statType).AddModifer(_relic_.statMod);
        // Adds the modified Stat to a list of Stats for later retrieval
        modifiedStat = DetermineStat(_characterStats, _relic_.relicData.statType);
    }
コード例 #13
0
        /// <summary>
        /// process the effects of using the relic
        /// </summary>
        /// <param name="relic">Relic</param>
        private void ProcessRelicUse(Relic relic)
        {
            string message;

            switch (relic.UseAction)
            {
            case Relic.UseActionType.OpenLocation:
                message = _gameMap.OpenLocationsByRelic(relic.Id);
                CurrentLocationInformation = relic.UseMessage;
                break;

            case Relic.UseActionType.UpgradePlayer:
                message = "You have upgraded your player armor one level";
                if (_player.SpecialArmor == Player.Armor.Low)
                {
                    _player.SpecialArmor = Player.Armor.Medium;
                }
                else
                {
                    _player.SpecialArmor = Player.Armor.High;
                }
                break;

            default:
                break;
            }
        }
コード例 #14
0
    private static void DrawTriggerZone(Relic relic, GizmoType gizmoType)
    {
        BoxCollider collider = relic.GetComponent <BoxCollider>();

        Gizmos.color  = Color.black;
        Gizmos.matrix = relic.transform.localToWorldMatrix;
        Gizmos.DrawWireCube(Vector3.zero, collider.size);
    }
    string generate_horrible(MainCharacter mc, Relic rel)
    {
        string s = "Tragically, like it was too late for the crew, it was too late for that " + mc.adjective + " " + mc.name + ", even after " + mc.he + " had abandoned the " + rel.item + ". ";

        s += "The famous " + mc.occupation + " was " + rel.cursed + " by a fate more horrible than any of the fates spoken of in the legends. ";
        s += mc.name + " was " + rel.cf + " by the " + rel.minions + " of " + rel.owner + ". ";
        return(s);
    }
    /* The branching story:
     * Advanture can lead to being: (generate_opening) COMPLETE
     *     cursed, which leads to: (generate_cursed). COMPLETE
     *         All the men die, you die of old age. (generate_old)
     *         Or, you die too, a horrible death somehow. (generate_horrible)
     *             In either case, the treasure is abandoned somewhere.Which leads to the end state. (generate_abandoned).
     *     scorned, all your crew turns on you. Which leads to: (generate_scorned)
     *         You are killed, and the treasure is taken. By your crew. (generate_killed)
     *         Or, they leave you stranded to die somehwere. (generate_stranded)
     *             In Either case, the crew utlimately kill each other, leaving the treasure somewhere along the route home. Which leads to the end state. (generate_lost).
     */

    string generate_opening(MainCharacter mc, Relic rel)
    {
        string s = "The great " + mc.adjective + " " + mc.occupation + " " + mc.name + " was noted for discovering the " + mc.history;

        s += ". However, " + mc.his + " forgotten discovery was the discovery of the " + rel.adjective + " " + rel.item + " of " + rel.owner + ". ";
        s += "This is not the tale of that discovery, but of what befell " + mc.him + " after... ";
        return(s);
    }
コード例 #17
0
 public void RelicRemove()
 {
     relic.OnExit();
     GetComponent <Image>().sprite = null;
     relic = null;
     gameObject.SetActive(false);
     IsActive = false;
 }
コード例 #18
0
ファイル: RelicForge.cs プロジェクト: MatiGP/GigaUltraDungeon
 public void PutRelicInTheForge(Relic relic)
 {
     relicToReforge = relic;
     relicInTheForgeButton.gameObject.SetActive(true);
     relicInTheForgeButton.image.sprite = relicToReforge.itemIcon;
     reforgeButton.gameObject.SetActive(true);
     costValueText.text = costOfReforging.ToString();
 }
    string generate_abandoned(MainCharacter mc, Relic rel, string minions, string god, string title)
    {
        string s = "The " + rel.adjective + " " + rel.item + " was left in " + title + ", in a truly desperate attempt to prevent the " + rel.curse + ". ";

        s += "It is watched over by the " + minions + " of " + god;
        s += ". It remains there to this day. ";
        return(s);
    }
コード例 #20
0
    void Awake()
    {
        spawnPoint = transform.FindChild("RelicSpawnPoint");
        relic      = this;

        //		InstantiateMWeapon(MainGM.maingm.inventoryItemHWeapon [MainGM.maingm.GridEquippedHWeapon, 0] - 1);
        //		InstantiateMWeapon(PlayerPrefs.GetInt ("invenMItemNum" + PlayerPrefs.GetInt ("GridEquippedMWeapon")) - 1);
    }
コード例 #21
0
 void RemoveRelic(Relic _relicToRemove_)
 {
     if (currentRelics.Contains(_relicToRemove_))
     {
         currentRelics.Remove(_relicToRemove_);
         _relicToRemove_.DeactivateRelic(this.transform);
     }
 }
コード例 #22
0
    public Relic GetRandomRelic()
    {
        int index = Random.Range(0, validChoices.Count);

        Relic output = lootTable.relics[validChoices[index]];

        return(output);
    }
コード例 #23
0
    Relic relic;                //relic object associated with this relic (just contains the sprite)


    // Start is called before the first frame update
    void Start()
    {
        allRelicsObject = GameObject.FindGameObjectWithTag("AllRelics");       //find our gameobject which has a reference to all relics
        relic           = allRelicsObject.GetComponent <AllRelics>().MagicDmg; // set our relic equal to the speific relic we want
        GameInformation.entities.player.GetComponent <Player>().magicDamageIncrease += relic.increaseValue;
        //relic.increaseValue is the percent increase, from 0 to 1. Ex. 0.1 = 10% increase.
        Inventory.instance.Add(relic); // add our relic to our inventory. This also takes care of updating the sprite in the UI.
    }
コード例 #24
0
ファイル: Relic_MaxHP.cs プロジェクト: RazaKazmi/BloodPact
    Relic relic;                //relic object associated with this relic (just contains the sprite)

    // Start is called before the first frame update
    void Start()
    {
        allRelicsObject = GameObject.FindGameObjectWithTag("AllRelics");    //find our gameobject which has a reference to all relics
        relic           = allRelicsObject.GetComponent <AllRelics>().maxHP; // set our relic equal to the speific relic we want
        GameInformation.entities.player.GetComponent <Player>().maxHealth += relic.increaseValue;
        GameInformation.entities.player.GetComponent <Player>().removeHP(0f);
        //relic.increase value for health and mana is their flat health/mana increase. Ex. 10 = 10 maxhealth increase.
        Inventory.instance.Add(relic); // add our relic to our inventory. This also takes care of updating the sprite in the UI.
    }
コード例 #25
0
ファイル: IFieldUpdater.cs プロジェクト: didii/WfPrimeTracker
 private void UpdateRelic(Relic source, Relic dest)
 {
     dest.Name      = source.Name;
     dest.Tier      = source.Tier;
     dest.IsVaulted = source.IsVaulted;
     dest.WikiUrl   = source.WikiUrl;
     dest.ImageId   = source.ImageId;
     dest.Image     = source.Image;
 }
コード例 #26
0
 public void PickUpRelic(Relic new_relic)
 {
     Debug.Log("Picked up relic " + new_relic.relic_name + ": " + new_relic.description);
     relics.Add(new_relic);
     foreach (Effect effect in new_relic.effects)
     {
         AddEffect(effect);
     }
 }
コード例 #27
0
 public void AddRelic(Relic relic)
 {
     validChoices.Remove(lootTable.relics.IndexOf(relic));
     relics.Add(relic);
     if (RelicDisplayController.relicDisplay != null)                //Check for relicDisplay since it doesn't exist in hte main menu scene
     {
         RelicDisplayController.relicDisplay.RefreshRelicDisplays();
     }
 }
    string generate_killed(MainCharacter mc, Relic rel, string fate_1, string fate_2, string fate)
    {
        string s = "Of all of the crew, only " + mc.his + " trusty " + mc.servant + " defended " + mc.him + ", citing " + mc.his + " generosity despite how " + mc.he + " " + mc.abuse + ". ";

        s += "Each of the crew came up with a terrible fate for the " + mc.occupation + ". One suggested " + mc.he + " be " + fate_1 + ". Another that " + mc.he + " be " + fate_2 + ". ";
        s += "Ultimately they settled that " + mc.he + " should be " + fate + ". Each crew member one by one spat on " + mc.him + ", as " + mc.he + " was ";
        s += fate + ". ";
        return(s);
    }
コード例 #29
0
ファイル: Relic.cs プロジェクト: Powerroff/simple_game
    public static Relic tempRelicOne()
    {
        Relic r = new Relic();

        r.name        = "Cognition Augment";
        r.description = "Allows player to select both options, at the cost of -1 stamina";
        r.onPickup    = () => { tempRelicOneFlag = true; };
        return(r);
    }
    string generate_lost(MainCharacter mc, Relic rel, string title)
    {
        string s = "Much like how the crew turned on " + mc.name + ", they turned on each other. " + mc.name + "'s trusted " + mc.servant + " was the first of the crew to be killed by";

        s += " the others. Each crew died one by one, as they each betrayed each other. The final crew member starved to death, alone. The " + rel.item + " was lost in the ";
        s += rel.location + " near";
        s += " the " + title + ". It was eventually taken to the " + title + ".";
        return(s);
    }
コード例 #31
0
    /// <summary>
    /// Adds a relic to the list of relics within this area, and changes the particle system's effects.
    /// </summary>
    /// <param name="relic"></param>
    private void AddRelicToList(Relic relic)
    {
        relicsInArea.Add(relic);
        var startSpeed = particleSystem.startSpeed;
        for (int g = 1; g <= 4; g++)
        {
            particleSystem.startSpeed += startSpeed * g;
            particleSystem.Emit(particlesPerRelic*4);
            particleSystem.startSpeed -= startSpeed * g;
        }
        particleSystem.startSize += sizePerRelic;
        particleSystem.emissionRate += particlesPerRelic;
        particleSystem.Play();

        if (RelicAdded != null)
            RelicAdded(this, relic);
    }
コード例 #32
0
    private void RemoveRelicFromList(Relic relic)
    {
        relicsInArea.Remove(relic);
        particleSystem.startSize -= sizePerRelic;
        particleSystem.emissionRate -= particlesPerRelic;

        if (RelicRemoved != null)
            RelicRemoved(this, relic);
    }