Example #1
0
 public PotionStaticData()
 {
     m_targetAttribute = EPotionTarget.HP;
     m_operation       = EPotionOperation.INCREASE_ABS;
     m_value           = 0;
     m_duration        = 0;
 }
Example #2
0
        private void OnAttributeRaised(Object p_sender, EventArgs p_args)
        {
            DummyCharacter selectedDummyCharacter = m_partyCreator.GetSelectedDummyCharacter();
            EPotionTarget  attribute = (p_sender as AttributeChanger).Attribute;

            if (attribute == EPotionTarget.MIGHT)
            {
                selectedDummyCharacter.IncreaseMight();
            }
            else if (attribute == EPotionTarget.MAGIC)
            {
                selectedDummyCharacter.IncreaseMagic();
            }
            else if (attribute == EPotionTarget.PERCEPTION)
            {
                selectedDummyCharacter.IncreasePerception();
            }
            else if (attribute == EPotionTarget.DESTINY)
            {
                selectedDummyCharacter.IncreaseDestiny();
            }
            else if (attribute == EPotionTarget.VITALITY)
            {
                selectedDummyCharacter.IncreaseVitality();
            }
            else if (attribute == EPotionTarget.SPIRIT)
            {
                selectedDummyCharacter.IncreaseSpirit();
            }
            UpdateCharacter();
            UpdateAttributes();
        }
Example #3
0
        public void Fill(TooltipType p_type, EPotionTarget p_attribute, Int32 p_currentIncrease, Character p_character, DummyCharacter p_dummy)
        {
            Init();
            m_atrribute = p_attribute;
            Single num = m_outerPadding + m_innerPadding;

            m_currentIncrease = p_currentIncrease;
            m_currentHeader.UpdatePositionY(-num);
            m_currentHeader.UpdateText(LocaManager.GetText("ATTRIBUTE_CURRENT"));
            num += m_currentHeader.Size.y + m_innerPadding;
            m_currentText.UpdatePositionY(-num);
            FillDescription(m_currentText, m_currentIncrease, p_character, p_dummy, false);
            num += m_currentText.Size.y + m_innerPadding;
            m_changeHeader.UpdatePositionY(-num);
            if (p_type == TooltipType.CURRENT_EFFECT_NEXT)
            {
                m_changeHeader.UpdateText(LocaManager.GetText("ATTRIBUTE_NEXT"));
            }
            else
            {
                m_changeHeader.UpdateText(LocaManager.GetText("ATTRIBUTE_PREV"));
            }
            num += m_changeHeader.Size.y + m_innerPadding;
            m_changeText.UpdatePositionY(-num);
            if (p_type == TooltipType.CURRENT_EFFECT_NEXT)
            {
                FillDescription(m_changeText, m_currentIncrease + 1, p_character, p_dummy, true);
            }
            else
            {
                FillDescription(m_changeText, m_currentIncrease - 1, p_character, p_dummy, true);
            }
            num += m_changeText.Size.y + m_innerPadding;
            m_background.Scale(m_currentHeader.Size.x + m_outerPadding * 2f, num - m_innerPadding + m_outerPadding);
        }
Example #4
0
 public IncreaseAttributeInteraction()
 {
     m_targetAttribute = EPotionTarget.NONE;
     m_addValue        = 0;
     m_isSingle        = false;
     m_isPermanent     = false;
 }
Example #5
0
        private void OnAttributeRaised(Object p_sender, EventArgs p_args)
        {
            Party         party     = LegacyLogic.Instance.WorldManager.Party;
            Character     member    = party.GetMember(party.CurrentCharacter);
            EPotionTarget attribute = (p_sender as AttributeChanger).Attribute;

            if (attribute == EPotionTarget.MIGHT)
            {
                member.AttributeChanger.IncreaseMight();
            }
            else if (attribute == EPotionTarget.MAGIC)
            {
                member.AttributeChanger.IncreaseMagic();
            }
            else if (attribute == EPotionTarget.PERCEPTION)
            {
                member.AttributeChanger.IncreasePerception();
            }
            else if (attribute == EPotionTarget.DESTINY)
            {
                member.AttributeChanger.IncreaseDestiny();
            }
            else if (attribute == EPotionTarget.VITALITY)
            {
                member.AttributeChanger.IncreaseVitality();
            }
            else if (attribute == EPotionTarget.SPIRIT)
            {
                member.AttributeChanger.IncreaseSpirit();
            }
            UpdateAttributes();
        }
Example #6
0
 public WhoWillFunction(Character p_char, EPotionTarget p_attribute, Int32 p_minValue, Int32 p_successDialogId, Int32 p_failDialogId)
 {
     m_char            = p_char;
     m_attribute       = p_attribute;
     m_minValue        = p_minValue;
     m_successDialogID = p_successDialogId;
     m_failDialogID    = p_failDialogId;
 }
Example #7
0
 public void Init(EPotionTarget p_attribute, Int32 p_baseValue, Int32 p_currentIncrease, ButtonType p_buttonType, Character p_character, DummyCharacter p_dummy)
 {
     m_attribute       = p_attribute;
     m_buttonType      = p_buttonType;
     m_baseValue       = p_baseValue;
     m_currentIncrease = p_currentIncrease;
     m_character       = p_character;
     m_dummy           = p_dummy;
 }
Example #8
0
 public override void SetData(EInteractiveObjectData p_key, String p_value)
 {
     if (p_key == EInteractiveObjectData.BARREL_DATA)
     {
         Int32            p_staticId = Convert.ToInt32(p_value);
         BarrelStaticData staticData = StaticDataHandler.GetStaticData <BarrelStaticData>(EDataType.BARRELS, p_staticId);
         Prefab            = staticData.Prefab;
         m_targetAttribute = staticData.TargetAttribute;
         m_value           = staticData.Value;
     }
 }
Example #9
0
 public void Init(String p_name, String p_TT, EPotionTarget p_attribute, Int32 p_baseValue, Int32 p_addValue, DummyCharacter p_dummyChar, Character p_realChar)
 {
     m_levelUpButton.Init(p_attribute, p_baseValue, p_addValue, AttributeLevelButton.ButtonType.PLUS, p_realChar, p_dummyChar);
     m_levelDownButton.Init(p_attribute, p_baseValue, p_addValue, AttributeLevelButton.ButtonType.MINUS, p_realChar, p_dummyChar);
     m_attribute      = p_attribute;
     m_dummyChar      = p_dummyChar;
     m_realChar       = p_realChar;
     m_baseValue      = p_baseValue;
     m_addValue       = p_addValue;
     m_TT             = p_TT;
     m_nameLabel.text = p_name;
     UpdateValueLabel();
     UpdateButtons();
 }
Example #10
0
 protected override void ParseExtra(String p_extra)
 {
     String[] array = p_extra.Split(new Char[]
     {
         ','
     });
     if (array.Length != 4)
     {
         throw new FormatException(String.Concat(new Object[]
         {
             "Could not parse interaction params ",
             p_extra,
             " because it contains ",
             array.Length,
             " arguments instead of ",
             4
         }));
     }
     if (!Enum.IsDefined(typeof(EPotionTarget), array[0]))
     {
         throw new FormatException("First parameter " + array[0] + " was not an EPotionTarget entry!");
     }
     m_targetAttribute = (EPotionTarget)Enum.Parse(typeof(EPotionTarget), array[0]);
     if (!Int32.TryParse(array[1], out m_addValue))
     {
         throw new FormatException("Second parameter " + array[1] + " was not an int value!");
     }
     if (!Boolean.TryParse(array[2], out m_isSingle))
     {
         throw new FormatException("Third parameter " + array[2] + " was not a single flag!");
     }
     if (!Boolean.TryParse(array[3], out m_isPermanent))
     {
         throw new FormatException("Fourth parameter " + array[3] + " was not a permanent flag!");
     }
 }
Example #11
0
        public void Show(MonoBehaviour p_caller, AttributeTooltip.TooltipType p_type, EPotionTarget p_attribute, Int32 p_currentIncrease, Vector3 p_position, Vector3 p_offset, Character p_character, DummyCharacter p_dummy)
        {
            m_tooltipCaller = p_caller;
            m_AttributeTooltip.Fill(p_type, p_attribute, p_currentIncrease, p_character, p_dummy);
            m_position = UICamera.currentCamera.WorldToScreenPoint(p_position);
            Single p_xOffset = m_tooltipOffset + 0.5f * m_AttributeTooltip.Scale.x + p_offset.x;
            Single p_yOffset = m_tooltipOffset + p_offset.y;

            AdjustAlignment(p_xOffset, p_yOffset, m_AttributeTooltip.Scale.x + p_offset.x, m_AttributeTooltip.Scale.y, EVerticalAlignmentType.MIDDLE);
            AdjustPosition();
            m_AttributeTooltip.Show();
        }
Example #12
0
        protected internal static BasePrecondition ParsePrecondition(String p_precondition)
        {
            if (p_precondition == "NONE" || p_precondition == String.Empty)
            {
                return(null);
            }
            String[] array = p_precondition.Split(new Char[]
            {
                ','
            });
            if (array[0] == "NONE")
            {
                return(null);
            }
            BasePrecondition      basePrecondition      = null;
            String                maintext              = String.Empty;
            String                successText           = String.Empty;
            String                failText              = String.Empty;
            String                text                  = String.Empty;
            EPotionTarget         attribute             = EPotionTarget.NONE;
            Int32                 requiredValue         = 0;
            EPreconditionDecision epreconditionDecision = (EPreconditionDecision)Enum.Parse(typeof(EPreconditionDecision), array[1]);

            maintext = array[2];
            if (epreconditionDecision == EPreconditionDecision.TEXT_INPUT && array.Length > 5)
            {
                text = array[5];
            }
            if (epreconditionDecision == EPreconditionDecision.WHO_WILL && array.Length > 5)
            {
                attribute     = (EPotionTarget)Enum.Parse(typeof(EPotionTarget), array[5]);
                requiredValue = Convert.ToInt32(array[6]);
            }
            if (array[0] == "PLAIN")
            {
                basePrecondition = new PlainPrecondition();
            }
            else
            {
                successText = array[3];
                failText    = array[4];
            }
            if (array[0] == "SELECT_CHARACTER")
            {
                basePrecondition = new SelectCharacterPrecondition();
            }
            if (array[0] == "TEST")
            {
                if (array.Length != 7)
                {
                    throw new FormatException(String.Concat(new Object[]
                    {
                        "Could not parse precondition params ",
                        p_precondition,
                        " because it contains ",
                        array.Length,
                        " arguments instead of ",
                        7
                    }));
                }
                basePrecondition = new TestPrecondition
                {
                    Attribute     = attribute,
                    RequiredValue = requiredValue,
                    SuccessText   = successText,
                    FailText      = failText
                };
            }
            if (array[0] == "CHALLENGE")
            {
                if (array.Length != 8 && array.Length != 7)
                {
                    throw new FormatException(String.Concat(new Object[]
                    {
                        "Could not parse precondition params ",
                        p_precondition,
                        " because it contains ",
                        array.Length,
                        " arguments instead of ",
                        8
                    }));
                }
                if (array.Length == 8)
                {
                    basePrecondition = new ChallengePrecondition
                    {
                        Attribute     = attribute,
                        RequiredValue = requiredValue,
                        SuccessText   = successText,
                        FailText      = failText,
                        Damage        = Convert.ToInt32(array[7])
                    };
                }
                else
                {
                    basePrecondition = new ChallengePrecondition
                    {
                        Attribute     = attribute,
                        RequiredValue = requiredValue,
                        SuccessText   = successText,
                        FailText      = failText,
                        Damage        = 0
                    };
                }
            }
            if (array[0] == "SECRET_CHALLENGE")
            {
                if (array.Length != 8)
                {
                    throw new FormatException(String.Concat(new Object[]
                    {
                        "Could not parse precondition params ",
                        p_precondition,
                        " because it contains ",
                        array.Length,
                        " arguments instead of ",
                        8
                    }));
                }
                basePrecondition = new SecretChallengePrecondition
                {
                    Attribute     = attribute,
                    RequiredValue = requiredValue,
                    SuccessText   = successText,
                    FailText      = failText,
                    Damage        = Convert.ToInt32(array[7])
                };
            }
            if (array[0] == "DISARM_TRAP")
            {
                if (array.Length != 7)
                {
                    throw new FormatException(String.Concat(new Object[]
                    {
                        "Could not parse precondition params ",
                        p_precondition,
                        " because it contains ",
                        array.Length,
                        " arguments instead of ",
                        7
                    }));
                }
                basePrecondition = new DisarmTrapPrecondition
                {
                    Attribute     = attribute,
                    RequiredValue = requiredValue,
                    SuccessText   = successText,
                    FailText      = failText
                };
            }
            if (array[0] == "INPUT")
            {
                if (array.Length != 6)
                {
                    throw new FormatException(String.Concat(new Object[]
                    {
                        "Could not parse precondition params ",
                        p_precondition,
                        " because it contains ",
                        array.Length,
                        " arguments instead of ",
                        6
                    }));
                }
                basePrecondition = new InputPrecondition
                {
                    WantedInput = text,
                    SuccessText = successText,
                    FailText    = failText
                };
            }
            if (array[0] == "UNLOCK_KEY")
            {
                if (array.Length != 6)
                {
                    throw new FormatException(String.Concat(new Object[]
                    {
                        "Could not parse precondition params ",
                        p_precondition,
                        " because it contains ",
                        array.Length,
                        " arguments instead of ",
                        6
                    }));
                }
                Int32 wantedPrivilege = 0;
                if (text != String.Empty)
                {
                    wantedPrivilege = Int32.Parse(text, CultureInfo.InvariantCulture.NumberFormat);
                }
                basePrecondition = new UnlockKeyPrecondition
                {
                    WantedPrivilege = wantedPrivilege,
                    SuccessText     = successText,
                    FailText        = failText
                };
            }
            if (array[0] == "PARTY_CHECK")
            {
                if (array.Length != 13 && array.Length != 10 && array.Length != 9 && array.Length != 8)
                {
                    throw new FormatException(String.Concat(new Object[]
                    {
                        "Could not parse precondition params ",
                        p_precondition,
                        " because it contains ",
                        array.Length,
                        " arguments instead of ",
                        13
                    }));
                }
                if (array.Length > 5)
                {
                    basePrecondition = new PartyCheckPrecondition
                    {
                        SuccessText               = successText,
                        FailText                  = failText,
                        RequiredTokenID           = Convert.ToInt32(array[5]),
                        RequiredBlessingID        = Convert.ToInt32(array[6]),
                        RequiredActiveQuestStepID = Convert.ToInt32(array[7])
                    };
                    if (array.Length > 8)
                    {
                        ((PartyCheckPrecondition)basePrecondition).RequiredFinishedQuestStepID = Convert.ToInt32(array[8]);
                    }
                    if (array.Length > 9)
                    {
                        ((PartyCheckPrecondition)basePrecondition).RequiredHirelingID = Convert.ToInt32(array[9]);
                    }
                    if (array.Length > 12)
                    {
                        ((PartyCheckPrecondition)basePrecondition).RequiredInactiveQuestStepID = Convert.ToInt32(array[10]);
                        ((PartyCheckPrecondition)basePrecondition).WithoutHirelingID           = Convert.ToInt32(array[11]);
                        ((PartyCheckPrecondition)basePrecondition).WithoutTokenID = Convert.ToInt32(array[12]);
                    }
                }
                else
                {
                    basePrecondition = new PartyCheckPrecondition
                    {
                        SuccessText = successText,
                        FailText    = failText
                    };
                }
            }
            basePrecondition.Decision = epreconditionDecision;
            basePrecondition.Maintext = maintext;
            return(basePrecondition);
        }
Example #13
0
        private void InitIncreasingProperties()
        {
            if (Operation == EPotionOperation.INCREASE_ABS || Operation == EPotionOperation.INCREASE_ABS_PERM)
            {
                switch (Target)
                {
                case EPotionTarget.HP:
                    m_properties["POTION_RESTORE_HEALTH_TT"] = Value.ToString();
                    break;

                case EPotionTarget.MANA:
                    m_properties["POTION_RESTORE_MANA_TT"] = Value.ToString();
                    break;

                case EPotionTarget.MIGHT:
                    m_properties["POTION_INCREASE_MIGHT_TT"] = Value.ToString();
                    break;

                case EPotionTarget.MAGIC:
                    m_properties["POTION_INCREASE_MAGIC_TT"] = Value.ToString();
                    break;

                case EPotionTarget.PERCEPTION:
                    m_properties["POTION_INCREASE_PERCEPTION_TT"] = Value.ToString();
                    break;

                case EPotionTarget.DESTINY:
                    m_properties["POTION_INCREASE_DESTINY_TT"] = Value.ToString();
                    break;

                case EPotionTarget.VITALITY:
                    m_properties["POTION_INCREASE_VITALIY_TT"] = Value.ToString();
                    break;

                case EPotionTarget.SPIRIT:
                    m_properties["POTION_INCREASE_SPIRIT_TT"] = Value.ToString();
                    break;

                case EPotionTarget.BASE_HP:
                    m_properties["POTION_INCREASE_HEALTH_TT"] = Value.ToString();
                    break;

                case EPotionTarget.BASE_MANA:
                    m_properties["POTION_INCREASE_MANA_TT"] = Value.ToString();
                    break;

                case EPotionTarget.ALL_ATTRIBUTES:
                    m_properties["POTION_INCREASE_ALL_STATS_TT"] = Value.ToString();
                    break;

                case EPotionTarget.ALL_RESISTANCES:
                    m_properties["POTION_INCREASE_ALL_RESIS_TT"] = Value.ToString();
                    break;

                case EPotionTarget.FIRE_RESISTANCE:
                    m_properties["POTION_INCREASE_FIRE_TT"] = Value.ToString();
                    break;

                case EPotionTarget.WATER_RESISTANCE:
                    m_properties["POTION_INCREASE_WATER_TT"] = Value.ToString();
                    break;

                case EPotionTarget.AIR_RESISTANCE:
                    m_properties["POTION_INCREASE_AIR_TT"] = Value.ToString();
                    break;

                case EPotionTarget.EARTH_RESISTANCE:
                    m_properties["POTION_INCREASE_EARTH_TT"] = Value.ToString();
                    break;

                case EPotionTarget.LIGHT_RESISTANCE:
                    m_properties["POTION_INCREASE_LIGHT_TT"] = Value.ToString();
                    break;

                case EPotionTarget.DARK_RESISTANCE:
                    m_properties["POTION_INCREASE_DARK_TT"] = Value.ToString();
                    break;
                }
            }
            if (Operation == EPotionOperation.INCREASE_PROZ)
            {
                EPotionTarget target = Target;
                if (target == EPotionTarget.MANA_AND_HP)
                {
                    m_properties["POTION_RESTORATION_TT"] = String.Empty;
                }
            }
        }
Example #14
0
 public override void Load(SaveGameData p_data)
 {
     base.Load(p_data);
     m_targetAttribute = p_data.Get <EPotionTarget>("TargetAttribute", EPotionTarget.MIGHT);
     m_value           = p_data.Get <Int32>("Value", 1);
 }