示例#1
0
    public string ApplyStatChanges(StatChanger statChanger)
    {
        Health   = Mathf.Clamp(Health + statChanger.HealthChange, -999999, 100);
        Grade    = Mathf.Clamp(Grade + statChanger.GradeChange, -999999, 12);
        Hunger   = Mathf.Clamp(Hunger + statChanger.HungerChange, -999999, 100);
        Social   = Mathf.Clamp(Social + statChanger.SocialChange, -999999, 100);
        MacCoins = Mathf.Clamp(MacCoins + statChanger.MacCoinsChange, -999999, 9999999);

        string update = "Stat Changes: \n";

        if (statChanger.HealthChange != 0)
        {
            update += "Health change: " + statChanger.HealthChange + "\n";
        }
        if (statChanger.GradeChange != 0)
        {
            update += "Grade change: " + statChanger.GradeChange + "\n";
        }
        if (statChanger.HungerChange != 0)
        {
            update += "Hunger change: " + statChanger.HungerChange + "\n";
        }
        if (statChanger.SocialChange != 0)
        {
            update += "Social change: " + statChanger.SocialChange + "\n";
        }
        if (statChanger.MacCoinsChange != 0)
        {
            update += "MacCoins change: " + statChanger.MacCoinsChange + "\n";
        }
        return(update);
    }
示例#2
0
 protected BulletBase(Danmaku danmaku,
                      Vector2f startPosition,
                      Vector2f size,
                      float hitboxRadius,
                      List <GameObject> targetObjects,
                      GameObject ownerObject,
                      EventHandler <EventArgs> onCollision,
                      int lifeTime,
                      RotatorBase rotator,
                      DeterminantOfDirectionOfMovementBase determinantOfDirectionOfMovement,
                      Texture texture,
                      WayOfDyingBase wayOfDyingBase,
                      StatChanger statChanger
                      )
     : base(danmaku, startPosition, size, hitboxRadius, lifeTime, texture)
 {
     TargetObjects  = targetObjects;
     OwnerObject    = ownerObject;
     WayOfDyingBase = wayOfDyingBase;
     DefineSaveDistances(TargetObjects);
     Collision += onCollision;
     _rotator   = rotator;
     _rotator.Initialize(this);
     DeterminantOfDirectionOfMovement = determinantOfDirectionOfMovement;
     DeterminantOfDirectionOfMovement.Initialize(this);
     WayOfDyingBase.Initialize(this);
     StatChanger = statChanger;
 }
示例#3
0
 public BonusBase(Danmaku danmaku, Vector2f startPosition, Texture texture, StatChanger statChanger)
     : base(danmaku, startPosition, new Vector2f(35, 35), 17, danmaku.MainObject,
            danmaku.SliceOfLifeBase.Shinigami,
            danmaku.SliceOfLifeBase.Shinigami.OnCollision,
            int.MaxValue / danmaku.FrameRateLimit,
            new NoneRotator(),
            new MovementInPredeterminedDirection(new Vector2f(0, 1)),
            texture,
            new NoneWayOfDying(danmaku),
            statChanger)
 {
 }
示例#4
0
 protected BulletBase(Danmaku danmaku,
                      Vector2f startPosition,
                      Vector2f size,
                      float hitboxRadius,
                      GameObject targetObject,
                      GameObject ownerObject,
                      EventHandler <EventArgs> onCollision,
                      int lifeTime,
                      Texture texture,
                      StatChanger statChanger)
     : this(danmaku, startPosition, size, hitboxRadius, new[] { targetObject }.ToList(), ownerObject, onCollision, lifeTime,
            new NoneRotator(),
            new NoneDeterminantOfDirectionOfMovement(),
            texture,
            new NoneWayOfDying(danmaku),
            statChanger)
 {
 }
示例#5
0
 public virtual void DeleteStatChanger(StatChanger stat)
 {
     StatChangers.Remove(stat);
 }
示例#6
0
 public virtual void AddStatChanger(StatChanger stat)
 {
     StatChangers.Add(stat);
 }