示例#1
0
        protected virtual void InitAttributes()
        {
            Attributes = new AttributeContainer();

            AddAttribute(new Attribute(
                             AttributeName.GoldReward,
                             GameSettings.NpcGoldBase,
                             GameSettings.NpcGoldInc,
                             LevelIncrementType.Flat));

            AddAttribute(new Attribute(
                             AttributeName.XPReward,
                             GameSettings.NpcXPBase,
                             GameSettings.NpcXPInc,
                             LevelIncrementType.Flat));

            AddAttribute(new Attribute(AttributeName.XPRewardFactor, 1));
            AddAttribute(new Attribute(AttributeName.GoldRewardFactor, 1));
        }
示例#2
0
 protected virtual void InitAttributes()
 {
     Attributes = new AttributeContainer();
 }
示例#3
0
 public Form(bool keepTime = false, int initialFrame = 0, double initialTime = 0)
     : base(keepTime, initialFrame, initialTime)
 {
     Begun = false;
     Attributes = new AttributeContainer();
 }
示例#4
0
 public void setStartAttributes()
 {
     narrativeShown = 1;
     //1 = easy; 2 = difficult
     difficulty = 1;
     //0 = mute; 1 = on
     soundVolume = 1;
     narrativeSoFar = "";
     showWarpHint = true;
     showLevelUp = false;
     fallFirst = true;
     doorOpen = false;
     //Singleton
     if (instance) {
         DestroyImmediate (gameObject);
         return;
     }
     else {
         DontDestroyOnLoad (gameObject);
         instance = this;
     }
     myAttributes = new AttributeContainer ();
     healthLowering.SetActive (false);
     healthHealing.SetActive (false);
     staminaDrain.SetActive (false);
     healthAltered = 0f;
     staminaDrained = 0f;
     justWarped = false;
     giveAlarm = true;
     gender = '?';
     dizzy = false;
     setInitialXp (0);
     nextRegeneration = Time.time + REGEN_INTERVAL;
     lastDamage = 0;
     CurrentLevel = 0;
 }
示例#5
0
    public void load(int slot)
    {
        AttributeContainer temp;
        try {
            var saveName = getSaveName(slot);
            if (!File.Exists(saveName))
                throw new IOException("Save file doesnt exsit");
            Stream stream = File.Open(saveName, FileMode.Open);
            BinaryFormatter bformatter = new BinaryFormatter();
            temp = (AttributeContainer)bformatter.Deserialize(stream);
            stream.Close();

            if (temp != null) {
                myAttributes = temp;
            }
        } catch (Exception e) {
            throw new Exception("Cannot load savegame: " + e.Message);
        }
    }
示例#6
0
 // Start is called before the first frame update
 private void Start()
 {
     Attributes = new AttributeContainer();
 }