// Token: 0x06000AFA RID: 2810 RVA: 0x0004F628 File Offset: 0x0004D828
 public void OnRecieveDamage(Damage damage)
 {
     if (damage.Type == DamageType.Stomp && Vector3.Dot(base.transform.rotation * Vector3.down, Characters.Sein.PlatformBehaviour.PlatformMovement.GravityDirection) > Mathf.Cos(0.17453292f) && !this.m_activated)
     {
         this.m_distanceStompedIntoGround = Mathf.Min(this.StompIntoGroundAmount, this.m_distanceStompedIntoGround + this.StompIntoGroundAmount / (float)this.NumberOfStomps);
         this.m_remainingRiseDelayTime    = this.RisingDelay;
         if (Mathf.Approximately(this.m_distanceStompedIntoGround, this.StompIntoGroundAmount))
         {
             BingoController.OnStompPost(this.MoonGuid);
             this.m_activated = true;
             if (this.AllTheWayInAction)
             {
                 this.AllTheWayInAction.Perform(null);
             }
             if (this.AllTheWayInSound)
             {
                 Sound.Play(this.AllTheWayInSound.GetSound(null), this.m_transform.position, null);
                 return;
             }
         }
         else if (this.StompSound)
         {
             Sound.Play(this.StompSound.GetSound(null), this.m_transform.position, null);
         }
     }
 }
Ejemplo n.º 2
0
 public static void ShowStats(int duration)
 {
     if (CurrentPage < PageCount)
     {
         string stats = GetStatsPage(CurrentPage);
         Randomizer.PrintImmediately(stats, duration, false, false, false);
         CurrentPage++;
         StatsTimer = duration;
     }
     else
     {
         CurrentPage = 0;
         if (StatsTimer > 0)
         {
             Randomizer.PrintImmediately("", 1, false, false, false);
             WriteStatsFile();
             if (RandomizerSettings.Dev && BingoController.Active)
             {
                 Randomizer.log("Bingo payload: " + BingoController.GetJson());
             }
         }
         else
         {
             ShowStats(duration);
         }
     }
 }
    // Token: 0x06001AA8 RID: 6824
    public new void FixedUpdate()
    {
        base.FixedUpdate();
        if (base.IsSuspended)
        {
            return;
        }
        bool flag;

        if (this.PlatformMovement.MovingHorizontally && EnemyStopper.InsideEnemyStopper(base.Position, (!base.FaceLeft) ? Vector3.right : Vector3.left, out flag))
        {
            base.FaceLeft = !base.FaceLeft;
            if (this.Controller.StateMachine.CurrentState == this.State.RunBack)
            {
                this.Controller.StateMachine.ChangeState(this.State.SpitterEnemyCharging);
            }
        }
        if (!this.PlatformMovement.IsSuspended && this.PlatformMovement.IsInAir)
        {
            this.PlatformMovement.LocalSpeedY -= this.Settings.Gravity * RandomizerBonusSkill.TimeScale(Time.deltaTime);
        }
        this.UpdateRotation();
        if (base.IsInWater)
        {
            base.Drown();
        }
        if (this.WilhelmScreamZoneRectanglesContain(base.transform.position) && !this.m_hasEnteredZone && this.EnterZoneAction)
        {
            this.m_hasEnteredZone = true;
            BingoController.OnScream();
            this.EnterZoneAction.Perform(null);
        }
    }
 // Token: 0x06000CC5 RID: 3269
 public void Increment()
 {
     this.m_counter++;
     if (this.m_counter == this.TriggerOnCounter)
     {
         BingoController.OnPurpleDoor(this.MoonGuid);
         base.DoTrigger(true);
     }
 }
 // Token: 0x0600051A RID: 1306
 public void OnMenuItemPressed()
 {
     if (this.CurrentSkillItem == null)
     {
         return;
     }
     if (this.CurrentSkillItem.HasSkillItem)
     {
         if (this.OnAlreadyEarnedAbility)
         {
             this.RequirementsLineAShake.Restart();
             this.OnAlreadyEarnedAbility.Perform(null);
         }
         return;
     }
     if (this.CurrentSkillItem.CanEarnSkill)
     {
         this.CurrentSkillItem.HasSkillItem = true;
         Characters.Sein.PlayerAbilities.SetAbility(this.CurrentSkillItem.Ability, true);
         Characters.Sein.PlayerAbilities.GainAbilityAction = this.CurrentSkillItem.GainSkillSequence;
         InstantiateUtility.Instantiate(this.GainSkillEffect, this.CurrentSkillItem.transform.position, Quaternion.identity);
         RandomizerBonus.SpentAP(this.CurrentSkillItem.ActualRequiredSkillPoints);
         BingoController.OnGainAbility(this.CurrentSkillItem.Ability);
         Characters.Sein.Level.SkillPoints -= this.CurrentSkillItem.ActualRequiredSkillPoints;
         if (this.OnGainAbility)
         {
             this.OnGainAbility.Perform(null);
         }
         SeinLevel.HasSpentSkillPoint = true;
         AchievementsController.AwardAchievement(this.SpentFirstSkillPointAchievement);
         GameController.Instance.CreateCheckpoint();
         RandomizerStatsManager.OnSave(false);
         GameController.Instance.SaveGameController.PerformSave();
         this.UpdateRequirementsText();
         return;
     }
     if (!this.CurrentSkillItem.SoulRequirementMet)
     {
         if (this.CurrentSkillItem.RequiresAbilitiesOrItems)
         {
             this.RequirementsLineAShake.Restart();
         }
         else
         {
             this.RequirementsLineAShake.Restart();
         }
     }
     if (!this.CurrentSkillItem.AbilitiesRequirementMet)
     {
         this.RequirementsLineAShake.Restart();
     }
     if (this.OnCantEarnSkill)
     {
         this.OnCantEarnSkill.Perform(null);
     }
 }
 // Token: 0x06001C78 RID: 7288 RVA: 0x000893FC File Offset: 0x000875FC
 public void Light(bool byGrenade)
 {
     BingoController.OnLanternLit(this.MoonGuid, byGrenade);
     this.m_isLit = true;
     if (this.OnLitAction)
     {
         this.OnLitAction.Perform(null);
     }
     this.UpdateLightSettings();
     if (byGrenade)
     {
         IgnitableSpiritTorch.OnLightTorchWithGrenadeEvent();
     }
 }
 public static bool SetTree(int treeNum)
 {
     if (!GetTree(treeNum))
     {
         TreeBitfield = Characters.Sein.Inventory.IncRandomizerItem(1001, 1 << treeNum);
         if (treeNum != 0)
         {
             BingoController.OnTree(treeNum);
             Characters.Sein.Inventory.IncRandomizerItem(27, 1);
         }
         return(true);
     }
     return(false);
 }
Ejemplo n.º 8
0
 // Token: 0x06002CE9 RID: 11497 RVA: 0x000C3C3C File Offset: 0x000C1E3C
 public static void Activate(string identifier, bool natural)
 {
     if (natural)
     {
         RandomizerSyncManager.FoundTP(identifier);
     }
     BingoController.OnActivateTeleporter(identifier);
     foreach (GameMapTeleporter gameMapTeleporter in TeleporterController.Instance.Teleporters)
     {
         if (gameMapTeleporter.Identifier == identifier)
         {
             gameMapTeleporter.Activated = true;
         }
     }
 }
 public static void ListMapstones()
 {
     try {
         UpdateBitfields();
         var owned   = new List <string>();
         var unowned = new List <string>();
         var touched = new List <string>();
         foreach (KeyValuePair <string, MapstoneData> d in Pedistals)
         {
             var data = d.Value;
             if ((MapstoneBitfield >> data.Bit) % 2 == 1)
             {
                 owned.Add(data.Zone);
             }
             else
             {
                 if (BingoController.Active && BingoController.TouchedMapstone(d.Key))
                 {
                     touched.Add(data.Zone);
                 }
                 else
                 {
                     unowned.Add(data.Zone);
                 }
             }
         }
         string output = "Maps active: " + string.Join(", ", owned.ToArray());
         if (touched.Count > 0)
         {
             output += "\ntouched: " + string.Join(", ", touched.ToArray());
         }
         if (unowned.Count > 0)
         {
             output += "\nremaining: " + string.Join(", ", unowned.ToArray());
         }
         Randomizer.printInfo(output);
     } catch (Exception e) {
         Randomizer.LogError("ListMapstones: " + e.Message);
     }
 }
Ejemplo n.º 10
0
 // Token: 0x06002FFE RID: 12286 RVA: 0x000CA688 File Offset: 0x000C8888
 public void Highlight()
 {
     if (this.OriTarget)
     {
         Characters.Ori.MoveOriToPosition(this.OriTarget.position, this.OriDuration);
     }
     if (Characters.Sein.Abilities.SpiritFlame)
     {
         Characters.Sein.Abilities.SpiritFlame.AddLock("mapStone");
     }
     Characters.Ori.GetComponent <Rigidbody>().velocity = Vector3.zero;
     Characters.Ori.EnableHoverWobbling = false;
     Characters.Ori.InsideMapstone      = true;
     BingoController.OnTouchMapstone();
     if (this.m_hint == null)
     {
         this.m_hint = UI.Hints.Show(this.HintMessage, HintLayer.HintZone, 3f);
     }
     if (this.OriEnterAction)
     {
         this.OriEnterAction.Perform(null);
     }
 }
Ejemplo n.º 11
0
    // Token: 0x06002F5A RID: 12122
    public void FixedUpdate()
    {
        switch (this.CurrentState)
        {
        case DoorWithSlots.State.Normal:
            if (this.SeinInRange && !this.OriHasTargets && Characters.Sein.Controller.CanMove)
            {
                this.Highlight();
                this.CurrentState = DoorWithSlots.State.Highlighted;
                return;
            }
            break;

        case DoorWithSlots.State.Highlighted:
            if (!this.SeinInRange)
            {
                this.RestoreOrbs();
                this.Unhighlight();
                this.CurrentState = DoorWithSlots.State.Normal;
            }
            if (!Characters.Sein.Controller.CanMove)
            {
                this.RestoreOrbs();
                this.Unhighlight();
                this.CurrentState = DoorWithSlots.State.Normal;
                return;
            }
            if (Characters.Sein.Controller.CanMove && !Characters.Sein.IsSuspended && Core.Input.SpiritFlame.OnPressed)
            {
                if (Characters.Sein.Inventory.Keystones == 0 && this.NumberOfOrbsRequired > this.NumberOfOrbsUsed)
                {
                    this.OnFailAction.Perform(null);
                    UI.SeinUI.ShakeKeystones();
                    if (this.NotEnoughLeafsSoundProvider)
                    {
                        Sound.Play(this.NotEnoughLeafsSoundProvider.GetSound(null), this.m_transform.position, null);
                    }
                }
                if (Characters.Sein.Inventory.Keystones > 0 && this.NumberOfOrbsUsed < this.NumberOfOrbsRequired)
                {
                    this.NumberOfOrbsUsed++;
                    Characters.Sein.Inventory.SpendKeystones(1);
                    if (this.PlaceLeafSoundSoundProvider)
                    {
                        Sound.Play(this.PlaceLeafSoundSoundProvider.GetSound(null), this.m_transform.position, null);
                    }
                }
                if (this.NumberOfOrbsUsed == this.NumberOfOrbsRequired)
                {
                    this.OnOpenedAction.Perform(null);
                    this.Unhighlight();
                    BingoController.OnKSDoor(this.MoonGuid);
                    this.CurrentState = DoorWithSlots.State.Opened;
                    if (this.OpenDoorSoundProvider)
                    {
                        this.m_openDoorSound = Sound.Play(this.OpenDoorSoundProvider.GetSound(null), this.m_transform.position, delegate()
                        {
                            this.m_openDoorSound = null;
                        });
                        this.m_openDoorSound.PauseOnSuspend = true;
                        return;
                    }
                }
            }
            break;

        case DoorWithSlots.State.Opened:
            if (this.m_checkItOpened)
            {
                this.m_checkItOpened = false;
                this.MakeSureItsAtEnd(base.transform.FindChild("doorPieces/doorLeft"));
                this.MakeSureItsAtEnd(base.transform.FindChild("doorPieces/doorRight"));
            }
            break;

        default:
            return;
        }
    }
    public static void GivePickup(RandomizerAction Action, int coords, bool found_locally = true)
    {
        try {
            switch (Action.Action)
            {
            case "RP":
            case "MU":
                string[] pieces = ((string)Action.Value).Split('/');
                for (int i = 0; i < pieces.Length; i += 2)
                {
                    string code = pieces[i];
                    if (Randomizer.StringKeyPickupTypes.Contains(code))
                    {
                        RandomizerSwitch.GivePickup(new RandomizerAction(code, pieces[i + 1]), coords, false);
                    }
                    else
                    {
                        int id;
                        int.TryParse(pieces[i + 1], out id);
                        RandomizerSwitch.GivePickup(new RandomizerAction(code, id), coords, false);
                    }
                }
                SilentMode = false;
                break;

            case "AC":
                SkillPointPickup();
                break;

            case "EC":
                MaxEnergyContainerPickup();
                break;

            case "EX":
                ExpOrbPickup((int)Action.Value);
                break;

            case "KS":
                KeystonePickup();
                break;

            case "HC":
                MaxHealthContainerPickup();
                break;

            case "MS":
                MapStonePickup();
                break;

            case "SK":
                if (Randomizer.CutscenePickupLocs.Contains(coords))
                {
                    Randomizer.FixCutscenePickup = (int)Action.Value;
                }
                AbilityPickup((int)Action.Value);
                break;

            case "EV":
                EventPickup((int)Action.Value);
                break;

            case "RB":
                RandomizerBonus.UpgradeID((int)Action.Value);
                break;

            case "TP":
                TeleportPickup((string)Action.Value);
                break;

            case "SH":
                string message = ((string)Action.Value).Replace("AltR", RandomizerRebinding.ReturnToStart.FirstBindName());
                if (message.Length > 1 && message[1] == '=')
                {
                    var parts = message.Split(',').ToList();
                    var flags = parts.FindAll(ele => ele.Length >= 2 && ele[1] == '=');
                    message = String.Join(",", parts.FindAll(ele => ele.Length < 2 || ele[1] != '=').ToArray());
                    int duration = 120;
                    foreach (var flag in flags)
                    {
                        var p = flag.Split('=');
                        if (p.Length != 2)
                        {
                            continue;
                        }
                        if (p[0] == "d")
                        {
                            int.TryParse(p[1], out duration);
                        }
                        else if (p[0] == "s")
                        {
                            SilentMode = (p[1].Trim().ToLower() == "true");
                        }
                    }
                    Randomizer.showHint(message, duration);
                }
                else
                {
                    Randomizer.showHint(message);
                }
                break;

            case "WT":
                RandomizerTrackedDataManager.SetRelic(Randomizer.RelicZoneLookup[(string)Action.Value]);
                int    relics   = Characters.Sein.Inventory.GetRandomizerItem(302);
                string relicStr = "\n(" + relics.ToString() + "/" + Randomizer.RelicCount.ToString() + ")";
                if (relics >= Randomizer.RelicCount)
                {
                    relicStr = "$" + relicStr + "$";
                }
                PickupMessage((string)Action.Value + relicStr, 480);
                break;

            case "WS":
            case "WP":
                Randomizer.SaveAfterWarp = Action.Action == "WS";
                string[] xy = ((string)Action.Value).Split(',');
                if (xy.Length > 2 && xy[2] == "force")
                {
                    Randomizer.WarpTo(new UnityEngine.Vector3(float.Parse(xy[0]), float.Parse(xy[1])), 15);
                }
                else
                {
                    Randomizer.WarpTarget = new UnityEngine.Vector3(float.Parse(xy[0]), float.Parse(xy[1]));
                    Randomizer.WarpSource = Characters.Sein.Position;
                    Randomizer.CanWarp    = 7;
                }
                break;

            case "NO":
                break;
            }
            BingoController.OnItem(Action, coords);
            RandomizerTrackedDataManager.UpdateBitfields();
        }
        catch (Exception e) {
            Randomizer.LogError("Give Pickup(" + Action.ToString() + ", " + coords.ToString() + "): " + e.Message);
        }
        if (found_locally && Randomizer.Sync)
        {
            RandomizerSyncManager.FoundPickup(Action, coords);
        }
        if (found_locally)
        {
            Randomizer.OnCoord(coords);
        }
    }
 // Token: 0x06002F85 RID: 12165 RVA: 0x000C9AC8 File Offset: 0x000C7CC8
 public void FixedUpdate()
 {
     if (!Characters.Sein)
     {
         return;
     }
     EnergyDoor.State currentState = this.CurrentState;
     if (currentState != EnergyDoor.State.Normal)
     {
         if (currentState == EnergyDoor.State.Highlighted)
         {
             if (!this.SeinInRange)
             {
                 this.RestoreOrbs();
                 this.Unhighlight();
                 this.CurrentState = EnergyDoor.State.Normal;
             }
             if (!Characters.Sein.Controller.CanMove)
             {
                 this.RestoreOrbs();
                 this.Unhighlight();
                 this.CurrentState = EnergyDoor.State.Normal;
                 return;
             }
             if (Characters.Sein.Controller.CanMove && !Characters.Sein.IsSuspended && Core.Input.SpiritFlame.OnPressed)
             {
                 if (Characters.Sein.Energy.Current < 1f && this.AmountOfEnergyRequired > this.AmountOfEnergyUsed)
                 {
                     this.OnFailAction.Perform(null);
                     Characters.Sein.Energy.NotifyOutOfEnergy();
                 }
                 if (Characters.Sein.Energy.Current >= 1f && this.AmountOfEnergyUsed < this.AmountOfEnergyRequired)
                 {
                     this.AmountOfEnergyUsed++;
                     Characters.Sein.Energy.Spend(1f);
                     this.UpdateSlots();
                     if (this.PlaceSlotSoundProvider)
                     {
                         Sound.Play(this.PlaceSlotSoundProvider.GetSound(null), this.m_transform.position, null);
                     }
                 }
                 if (this.AmountOfEnergyUsed == this.AmountOfEnergyRequired)
                 {
                     BingoController.OnEnergyDoor(this.MoonGuid);
                     this.OnOpenedAction.Perform(null);
                     this.Unhighlight();
                     this.CurrentState = EnergyDoor.State.Opened;
                     if (this.ActivateSoundProvider)
                     {
                         Sound.Play(this.ActivateSoundProvider.GetSound(null), this.m_transform.position, null);
                         return;
                     }
                 }
             }
         }
     }
     else if (this.SeinInRange && !this.OriHasTargets && Characters.Sein.Controller.CanMove)
     {
         this.Highlight();
         this.CurrentState = EnergyDoor.State.Highlighted;
     }
 }
    // Token: 0x060017AC RID: 6060 RVA: 0x0007AAFC File Offset: 0x00078CFC
    public override void OnRecieveDamage(Damage damage)
    {
        bool terrain = (damage.Type == DamageType.Crush || damage.Type == DamageType.Spikes || damage.Type == DamageType.Lava || damage.Type == DamageType.Laser);

        if (this.Entity is Enemy && !(terrain || damage.Type == DamageType.Projectile || damage.Type == DamageType.Enemy))
        {
            RandomizerBonus.DamageDealt(damage.Amount);
        }
        this.OnModifyDamage(damage);
        if (damage.Type == DamageType.Enemy)
        {
            return;
        }
        if (damage.Type == DamageType.Projectile)
        {
            damage.SetAmount(damage.Amount * 4f);
        }
        if (damage.Type == DamageType.Spikes || damage.Type == DamageType.Lava)
        {
            damage.SetAmount(1000f);
        }
        if (this.Entity.gameObject != base.gameObject)
        {
            damage.DealToComponents(this.Entity.gameObject);
        }
        base.OnRecieveDamage(damage);
        if (base.NoHealthLeft)
        {
            EntityDamageReciever.OnEntityDeathEvent(this.Entity);
            if (damage.Type == DamageType.Projectile && this.Entity is Enemy)
            {
                Projectile component = damage.Sender.GetComponent <Projectile>();
                if (component != null && component.HasBeenBashedByOri)
                {
                    AchievementsLogic.Instance.OnProjectileKilledEnemy();
                }
                if (component != null && !component.HasBeenBashedByOri)
                {
                    AchievementsLogic.Instance.OnEnemyKilledAnotherEnemy();
                }
            }
            if (terrain)
            {
                Type type = this.Entity.GetType();
                if (type != typeof(DropSlugEnemy) && type != typeof(KamikazeSootEnemy) && !base.gameObject.name.ToLower().Contains("wall"))
                {
                    AchievementsLogic.Instance.OnEnemyKilledItself();
                }
            }
            if (this.Entity is Enemy)
            {
                BingoController.OnDestroyEntity(this.Entity, damage);
                RandomizerStatsManager.OnKill(damage.Type);
                if (damage.Type == DamageType.ChargeFlame)
                {
                    if (Characters.Sein && Characters.Sein.Abilities.Dash)
                    {
                        if (Characters.Sein.Abilities.Dash.CurrentState == SeinDashAttack.State.ChargeDashing)
                        {
                            AchievementsLogic.Instance.OnChargeDashKilledEnemy();
                        }
                        else
                        {
                            AchievementsLogic.Instance.OnChargeFlameKilledEnemy();
                        }
                    }
                    else
                    {
                        AchievementsLogic.Instance.OnChargeFlameKilledEnemy();
                    }
                }
                else if ((damage.Type == DamageType.Stomp && damage.Force.y < 0f) || damage.Type == DamageType.StompBlast)
                {
                    AchievementsLogic.Instance.OnStompKilledEnemy();
                }
                else if (damage.Type == DamageType.SpiritFlameSplatter || damage.Type == DamageType.SpiritFlame)
                {
                    AchievementsLogic.Instance.OnSpiritFlameKilledEnemy();
                }
                else if (damage.Type == DamageType.Grenade)
                {
                    AchievementsLogic.Instance.OnGrenaedKilledEnemy();
                }
            }
            if (this.Entity is PetrifiedPlant)
            {
                Randomizer.getPickup(this.Entity.Position);
                RandomizerPlantManager.DestroyPlant(this.Entity.MoonGuid);
            }
        }
    }