static void Postfix(Stalker __instance) { try { var model = Findstalker.Find_stalker(__instance); if (model != null || true) { var skinnedRenderer = model.GetComponent <SkinnedMeshRenderer>(); var texture = TextureUtils.LoadTexture(@"./QMods/stalkerCamo/stalkerCamoDiff.png"); skinnedRenderer.sharedMaterial.mainTexture = texture; Console.WriteLine("[stalkerCamo] Running as intended![this is a message to see if the stalker creature gets called properly]"); } else { Console.WriteLine("[stalkerCamo] An unknown error occured. Stalker game object is null"); } } catch (Exception e) { string naam = "stalker"; Console.WriteLine("[" + naam + "]" + e.Message); Console.WriteLine("[" + naam + "]" + e.StackTrace); Console.WriteLine("End error" + naam); } }
public List <Build> GetBuilds(Bot bot, string[] lines) { List <Build> options = new List <Build>(); if (Bot.Main.EnemyRace == Race.Protoss) { if (Stalker.Get().DetectedPreviously && Zealot.Get().DetectedPreviously && !Immortal.Get().DetectedPreviously) { options.Add(new DefensiveSentries() { DelayAttacking = true }); //options.Add(new MassSentries() { SkipNatural = true }); //options.Add(new GreedySentries()); return(options); } if (!Stalker.Get().DetectedPreviously && Zealot.Get().DetectedPreviously && !Immortal.Get().DetectedPreviously) { //options.Add(new DefensiveSentries() { DelayAttacking = true }); options.Add(new MassSentries() { SkipNatural = true }); return(options); } } if (Bot.Main.EnemyRace == Race.Zerg) { if ((Zergling.Get().DetectedPreviously || Roach.Get().DetectedPreviously) && !Hydralisk.Get().DetectedPreviously) { options.Add(new DefensiveSentries()); return(options); } } if (Bot.Main.EnemyRace == Race.Terran && Battlecruiser.Get().DetectedPreviously&& !SiegeTank.Get().DetectedPreviously) { options.Add(new MassSentries() { AntiBC = true }); return(options); } options.Add(new MassSentries()); options.Add(new GreedySentries()); options.Add(new DefensiveSentries() { DelayAttacking = true }); return(options); }
static void Main() { var profile = new SocialMediaProfile("Niki"); var creeper = new Creeper(); profile.Accept(creeper); Console.WriteLine(profile); var stalker = new Stalker(); profile.Accept(stalker); Console.WriteLine(profile); }
private void OnStalkerDeathEvent(Stalker deadStalker) { if (deadStalker.isDead) { Stalker.secondaryTargets.Add(deadStalker); SpawnNewStalker(); } else { Stalker.secondaryTargets.Remove(deadStalker); } }
void Start() { c = GetComponent <Stalker>(); foreach (var v in GetComponents <AggressiveWhenSeeTarget>()) { Destroy(v); } Destroy(GetComponent <PrisonPredatorSwimToPlayer>()); foreach (var v in GetComponents <MoveTowardsTarget>()) { Destroy(v); } var co0 = GetComponent <CollectShiny>(); var co1 = gameObject.AddComponent <CollectShinyV2>(); co1.mouth = co0.mouth; co1.shinyTargetAttach = co0.shinyTargetAttach; co1.eventQualifier = co0.eventQualifier; co1.swimVelocity = co0.swimVelocity; co1.swimInterval = co0.swimInterval; co1.updateTargetInterval = co0.updateTargetInterval; Destroy(co0); gameObject.AddComponent <AggressiveWhenSeePlayer>(); var alt = GetComponent <AttackLastTarget>(); var alt1 = gameObject.AddComponent <AttackPlayerWhenAggressive>(); alt1.copyAttackLastTarget(alt); Destroy(alt); alt1.minAttackDuration = 1.5f; alt1.maxAttackDuration = 3f; alt1.pauseInterval = 10f; /*var ma0 = GetComponent<MeleeAttack>(); * * var ma1 = gameObject.AddComponent<MeleeAttackV2>(); * * ma1.copyMeleeAttack(ma0); * * Destroy(ma0);*/ }
public void SpawnNewStalker() { Vector2Int coordinates = board.GetRandomCell(true, Stalker.target.Coordinates, 2).coordinates; Stalker newStalker = Instantiate <Stalker>(stalkerPrefab, null); newStalker.Init(); newStalker.SetCoordinates(coordinates); newStalker.dieEvent.AddListener(OnStalkerDeathAction); newStalker.StartCoroutine(newStalker.PlayTurnCoroutine()); stalkers.Add(newStalker); }
static void Main() { var profile = new SocialMediaProfile("MitioPishtovaPrezident"); var creeper = new Creeper(); profile.Accept(creeper); Console.WriteLine(profile); var stalker = new Stalker(); profile.Accept(stalker); Console.WriteLine(profile); }
public static GameObject Find_stalker(Stalker __instance) { var gameObject = __instance.gameObject; try { Console.WriteLine("utils succes"); return(gameObject.FindChild("Stalker_02").FindChild("snout_shark_geo"));//.FindChild("Stalker_02").FindChild("snout_shark_geo"); ; } catch { Console.WriteLine("utils fail"); return(gameObject); } }
//GetComponent<HardnessMixin> was returning null for everything instead of a HardnessMixin with a hardness value. Since this component //isn't used for anything else than the stalker teeth drop, we hard-code the values and bingo. public static bool Prefix(Stalker __instance, GameObject target) { float dropProbability = 0f; TechType techType = CraftData.GetTechType(target); if (techType == TechType.ScrapMetal) { dropProbability = 0.15f; // 15% probability } if (UnityEngine.Random.value < dropProbability) { __instance.LoseTooth(); } return(false); }
private void OnTriggerEnter2D(Collider2D collision) { Agent agent = collision.GetComponent <Agent>(); if (agent != null) { Debug.Log("GAME OVER"); } Stalker stalker = collision.GetComponent <Stalker>(); if (stalker != null && stalker.isDead) { stalker.Ressucitate(); } }
static void Postfix(Stalker __instance) { __instance.gameObject.AddComponent <StalkerPatch>(); }
public override void OnFrame(Bot bot) { bot.TaskManager.CombatSimulation.SimulationLength = 0; if (Completed(UnitTypes.WARP_PRISM) > 0) { StopWarpPrisms = true; } if (ProxySuspected) { bot.TargetManager.TargetAllBuildings = true; MassSentriesTask.Task.RequiredSize = 15; MassSentriesTask.Task.RetreatSize = 6; } else if (bot.EnemyRace == Race.Protoss && !Stalker.Get().DetectedPreviously) { MassSentriesTask.Task.RequiredSize = 50; MassSentriesTask.Task.RetreatSize = 10; } else if (bot.EnemyRace == Race.Terran && SiegeTank.Get().DetectedPreviously) { MassSentriesTask.Task.RequiredSize = 50; MassSentriesTask.Task.RetreatSize = 10; } else if (!WarpPrismDrops) { MassSentriesTask.Task.RequiredSize = 25; MassSentriesTask.Task.RetreatSize = 10; } else if (MassSentriesTask.Task.AttackSent || Completed(UnitTypes.WARP_PRISM) > 0) { MassSentriesTask.Task.RequiredSize = 20; MassSentriesTask.Task.RetreatSize = 10; } else { MassSentriesTask.Task.RequiredSize = 30; MassSentriesTask.Task.RetreatSize = 10; } TrainStep.WarpInLocation = null; if (Completed(UnitTypes.WARP_PRISM_PHASING) > 0) { foreach (Agent agent in bot.Units()) { if (agent.Unit.UnitType != UnitTypes.WARP_PRISM_PHASING) { continue; } TrainStep.WarpInLocation = SC2Util.To2D(agent.Unit.Pos); break; } } if (Bot.Main.Frame <= 2) { SentryWarpInTask.Task.Stopped = true; } else if (MassSentriesTask.Task.AttackSent) { SentryWarpInTask.Task.Stopped = false; } bot.DrawText("SentryWarpInTask Stopped: " + SentryWarpInTask.Task.Stopped); DefenseTask.GroundDefenseTask.UseForceFields = true; if (NaturalWall.Wall.Count >= 4 && Count(UnitTypes.NEXUS) < 2) { DefenseTask.GroundDefenseTask.MainDefenseRadius = 40; DefenseTask.GroundDefenseTask.ExpandDefenseRadius = 25; IdleTask.Task.OverrideTarget = NaturalDefensePos; } else { DefenseTask.GroundDefenseTask.MainDefenseRadius = 20; DefenseTask.GroundDefenseTask.ExpandDefenseRadius = 25; IdleTask.Task.OverrideTarget = null; } if (WorkerScoutTask.Task.BaseCircled() && (bot.EnemyRace != Race.Zerg || !DefenseMode)) { WorkerScoutTask.Task.Stopped = true; WorkerScoutTask.Task.Clear(); } if (!DefenseMode && TotalEnemyCount(UnitTypes.ROACH_WARREN) > 0 && bot.Frame <= 22.4 * 90 && !Expanded.Get().Detected) { DefenseMode = true; } if (!DefenseMode && TotalEnemyCount(UnitTypes.BARRACKS) == 0 && bot.Frame >= 22.4 * 90 && bot.Frame <= 22.4 * 120 && bot.EnemyRace == Race.Terran && !Expanded.Get().Detected) { DefenseMode = true; ProxySuspected = true; } if (!DefenseMode && FourRax.Get().Detected&& bot.Frame <= 22.4 * 90 && !Expanded.Get().Detected) { DefenseMode = true; } if (!DefenseMode && TotalEnemyCount(UnitTypes.SPAWNING_POOL) > 0 && bot.Frame <= 22.4 * 80 && !Expanded.Get().Detected) { DefenseMode = true; } if (Expanded.Get().Detected) { DefenseMode = false; } KillOwnUnitTask.Task.Priority = 6; if (Count(Main, UnitTypes.FORGE) > 0 && Completed(UnitTypes.SENTRY) >= 18 && NaturalWall.Wall.Count >= 4) { foreach (Agent agent in bot.Units()) { if (agent.Unit.UnitType != UnitTypes.FORGE) { continue; } if (agent.DistanceSq(NaturalWall.Wall[0].Pos) <= 4) { KillOwnUnitTask.Task.TargetTag = agent.Unit.Tag; break; } } } if (NaturalWall.Wall.Count >= 4) { if (Count(Main, UnitTypes.FORGE) > 0 && Completed(UnitTypes.SENTRY) >= 18) { bot.buildingPlacer.LimitBuildArea = null; } else { bot.buildingPlacer.LimitBuildArea = MainAndNatural; } } if (Completed(UnitTypes.SENTRY) >= 15) { DefenseMode = false; } ForceFieldRampTask.Task.Stopped = (!SkipNatural && !DefenseMode) || NaturalWall.Wall.Count >= 4; if (ForceFieldRampTask.Task.Stopped) { ForceFieldRampTask.Task.Clear(); } if (!TyckleFightChatSent && StrategyAnalysis.WorkerRush.Get().Detected) { TyckleFightChatSent = true; bot.Chat("TICKLE FIGHT! :D"); } if (!MessageSent) { if (MassSentriesTask.Task.AttackSent) { MessageSent = true; bot.Chat("Prepare to be TICKLED! :D"); } } foreach (Agent agent in bot.UnitManager.Agents.Values) { if (bot.Frame % 224 != 0) { break; } if (agent.Unit.UnitType != UnitTypes.GATEWAY) { continue; } if (MassSentriesTask.Task.Units.Count == 0) { agent.Order(Abilities.MOVE, Main.BaseLocation.Pos); } else { agent.Order(Abilities.MOVE, bot.TargetManager.PotentialEnemyStartLocations[0]); } } }
void Start() { stalk = GetComponent <Stalker>(); enemy = GetComponent <Rigidbody2D>(); }
public List <Build> ProtossBuilds(Bot bot) { List <Build> options = new List <Build>(); if (Bot.Debug) { foreach (Strategy strategy in bot.EnemyStrategyAnalyzer.Strategies) { if (strategy.DetectedPreviously) { System.Console.WriteLine("Detected previous strategy: " + strategy.Name()); } } } if (bot.EnemyRace == Race.Terran) { if (Marine.Get().DetectedPreviously && !Reaper.Get().DetectedPreviously && !Marauder.Get().DetectedPreviously && !Cyclone.Get().DetectedPreviously && !Banshee.Get().DetectedPreviously && !SiegeTank.Get().DetectedPreviously && !Medivac.Get().DetectedPreviously && !Viking.Get().DetectedPreviously && !Raven.Get().DetectedPreviously && !Battlecruiser.Get().DetectedPreviously && !WidowMine.Get().DetectedPreviously && !Hellion.Get().DetectedPreviously && !Thor.Get().DetectedPreviously && !Liberator.Get().DetectedPreviously) { // ValinMarineBot options.Add(new NinjaTurtles()); return(options); } if (BattlecruiserRush.Get().DetectedPreviously && Thor.Get().DetectedPreviously && WidowMine.Get().DetectedPreviously) { // BenBotBC options.Add(new OneBaseStalkerImmortal()); return(options); } if (Battlecruiser.Get().DetectedPreviously && !BattlecruiserRush.Get().DetectedPreviously && !Marauder.Get().DetectedPreviously && !Banshee.Get().DetectedPreviously && !Reaper.Get().DetectedPreviously && !Cyclone.Get().DetectedPreviously && !Medivac.Get().DetectedPreviously && !Raven.Get().DetectedPreviously) { options.Add(new MassVoidray() { SkipDefenses = true }); return(options); } /* * if (ProxyDetected.Get().DetectedPreviously * && !Marauder.Get().DetectedPreviously * && Banshee.Get().DetectedPreviously) * { * options.Add(new AntiMicro()); * return options; * } */ if (ProxyDetected.Get().DetectedPreviously && Marauder.Get().DetectedPreviously && Banshee.Get().DetectedPreviously) { // MicroMachine options.Add(new AntiMicro() { HuntProxies = true, CounterProxyMarauder = false }); //options.Add(new NinjaTurtles() { Expand = true }); //options.Add(new OneBaseTempest() { DefendingStalker = true }); return(options); } if (ProxyDetected.Get().DetectedPreviously && !Banshee.Get().DetectedPreviously) { // Strelok //options.Add(new PvTStalkerImmortal() { BuildReaperWall = true, ProxyPylon = false, DelayObserver = true, SendScout = true, MassTanksDetected = MassTank.Get().DetectedPreviously }); options.Add(new OneBaseStalkerImmortal() { UseSentry = true }); options.Add(new OneBaseTempest()); return(options); } if (Marine.Get().DetectedPreviously && Medivac.Get().DetectedPreviously && Viking.Get().DetectedPreviously && Reaper.Get().DetectedPreviously && Raven.Get().DetectedPreviously && !Cyclone.Get().DetectedPreviously && !Marauder.Get().DetectedPreviously && !Banshee.Get().DetectedPreviously) { options.Add(new OneBaseStalkerImmortal()); //options.Add(new PvTStalkerImmortal() { BuildReaperWall = false, ProxyPylon = false, DelayObserver = true, SendScout = false, MassTanksDetected = true }); return(options); } if (Marine.Get().DetectedPreviously && Medivac.Get().DetectedPreviously && Viking.Get().DetectedPreviously && Reaper.Get().DetectedPreviously && !Raven.Get().DetectedPreviously && Marauder.Get().DetectedPreviously && Liberator.Get().DetectedPreviously && !Banshee.Get().DetectedPreviously) { // Jensiiibot //options.Add(new PvTStalkerTempest()); //options.Add(new Builds.Protoss.WorkerRush() { CounterJensiii = true, BuildStalkers = true }); //options.Add(new PvTStalkerImmortal() { BuildReaperWall = true, ProxyPylon = false, DelayObserver = true, MassTanksDetected = MassTank.Get().DetectedPreviously, UseColosus = false }); options.Add(new PvTZealotImmortal()); return(options); } if (Marine.Get().DetectedPreviously && Medivac.Get().DetectedPreviously && Viking.Get().DetectedPreviously && Reaper.Get().DetectedPreviously && Cyclone.Get().DetectedPreviously && !Marauder.Get().DetectedPreviously && !Liberator.Get().DetectedPreviously && !Banshee.Get().DetectedPreviously) { // Rusty options.Add(new OneBaseStalkerImmortal()); return(options); } if (Marine.Get().DetectedPreviously && Medivac.Get().DetectedPreviously && Viking.Get().DetectedPreviously && Reaper.Get().DetectedPreviously && !Raven.Get().DetectedPreviously && Cyclone.Get().DetectedPreviously && Marauder.Get().DetectedPreviously && !Liberator.Get().DetectedPreviously && !Banshee.Get().DetectedPreviously && Thor.Get().DetectedPreviously && SiegeTank.Get().DetectedPreviously && MassTank.Get().DetectedPreviously && Hellbat.Get().DetectedPreviously) { // MechSweep options.Add(new OneBaseTempest() { RequiredSize = 3 }); return(options); } options.Add(new PvTStalkerImmortal() { BuildReaperWall = true, ProxyPylon = false, DelayObserver = true, MassTanksDetected = MassTank.Get().DetectedPreviously, UseColosus = false }); } else if (bot.EnemyRace == Race.Zerg) { if (Bot.Main.OpponentID == "eed44128-f488-4e31-b457-8e55f8a95628") { options.Add(new PvZHjax() { CounterRoaches = false, DefendNydus = false }); return(options); } options.Add(new PvZHjax()); return(options); /* * if (Lurker.Get().DetectedPreviously) * { * //Kagamine * //options.Add(new PvZAdeptIntoVoidray()); * //options.Add(new WorkerRush()); * options.Add(new PvZHjax()); * return options; * } * if (Mutalisk.Get().DetectedPreviously * && !Lurker.Get().DetectedPreviously) * { * options.Add(new OneBaseStalkerImmortal() { StartZealots = true }); * return options; * } * if (Hydralisk.Get().DetectedPreviously && StrategyAnalysis.ZerglingRush.Get().DetectedPreviously) * { * options.Add(new ZealotRush()); * return options; * } * if (RoachRush.Get().DetectedPreviously || StrategyAnalysis.ZerglingRush.Get().DetectedPreviously) * { * options.Add(new PvZRushDefense()); * options.Add(new NinjaTurtles()); * return options; * } * if (Roach.Get().DetectedPreviously * && Zergling.Get().DetectedPreviously * && !Hydralisk.Get().DetectedPreviously) * { * options.Add(new PvZRushDefense()); * options.Add(new NinjaTurtles()); * return options; * } * if (Queen.Get().DetectedPreviously * && Zergling.Get().DetectedPreviously * && !Hydralisk.Get().DetectedPreviously * && !Roach.Get().DetectedPreviously) * { * options.Add(new NinjaTurtles()); * return options; * } * if (bot.PreviousEnemyStrategies.MassHydra * && MassRoach.Get().DetectedPreviously * && !Lurker.Get().DetectedPreviously) * { * options.Add(new OneBaseTempest()); * return options; * } * if (!Zergling.Get().DetectedPreviously * && !Roach.Get().DetectedPreviously * && !Hydralisk.Get().DetectedPreviously * && !Queen.Get().DetectedPreviously * && !Mutalisk.Get().DetectedPreviously) * { * options.Add(new OneBaseTempest()); * return options; * } * if (!Zergling.Get().DetectedPreviously * && Roach.Get().DetectedPreviously * && !Hydralisk.Get().DetectedPreviously * && Queen.Get().DetectedPreviously * && !Mutalisk.Get().DetectedPreviously) * { * options.Add(new OneBaseTempest()); * return options; * } * options.Add(new OneBaseStalkerImmortal() { StartZealots = true }); */ } else if (bot.EnemyRace == Race.Protoss) { if (Zealot.Get().DetectedPreviously && VoidRay.Get().DetectedPreviously && !Carrier.Get().DetectedPreviously && !Tempest.Get().DetectedPreviously && !Stalker.Get().DetectedPreviously && !Adept.Get().DetectedPreviously && !Immortal.Get().DetectedPreviously && !StrategyAnalysis.CannonRush.Get().DetectedPreviously) { // MavBot3 options.Add(new ZealotRush()); return(options); } if (SkippedNatural.Get().DetectedPreviously && !AdeptHarass.Get().DetectedPreviously && VoidRay.Get().DetectedPreviously && Immortal.Get().DetectedPreviously) { // AdditionalPylons options.Add(new DoubleRoboProxy()); return(options); } if (Oracle.Get().DetectedPreviously && ThreeGate.Get().DetectedPreviously && Zealot.Get().DetectedPreviously && !Stalker.Get().DetectedPreviously && !VoidRay.Get().DetectedPreviously && !Immortal.Get().DetectedPreviously) { // LuckyBot options.Add(new OneBaseTempest()); return(options); } if (Carrier.Get().DetectedPreviously && Collosus.Get().DetectedPreviously && SkyToss.Get().DetectedPreviously && Tempest.Get().DetectedPreviously && !Archon.Get().DetectedPreviously && !HighTemplar.Get().DetectedPreviously) { // TheGoldenArmada options.Add(new OneBaseTempest()); return(options); } options.Add(new OneBaseStalkerImmortal() { DoubleRobo = true, EarlySentry = true, AggressiveMicro = true }); return(options); /* * if (AdeptHarass.Get().DetectedPreviously * && SkyToss.Get().DetectedPreviously * && Carrier.Get().DetectedPreviously * && HighTemplar.Get().DetectedPreviously * && VoidRay.Get().DetectedPreviously * && !StrategyAnalysis.CannonRush.Get().DetectedPreviously) * { * options.Add(new ZealotRush()); * options.Add(new OneBaseStalkerImmortal()); * return options; * } * if (AdeptHarass.Get().DetectedPreviously) * { * // SharpenedEdge * options.Add(new OneBaseTempest()); * options.Add(new Dishwasher()); * return options; * } * if (StrategyAnalysis.CannonRush.Get().DetectedPreviously * && Tempest.Get().DetectedPreviously) * { * // ThreeWayLover * //options.Add(new MassVoidray() { SkipDefenses = true }); * options.Add(new OneBaseTempest()); * return options; * } * if (Sentry.Get().DetectedPreviously * && Archon.Get().DetectedPreviously * && !Stalker.Get().DetectedPreviously * && !Zealot.Get().DetectedPreviously) * { * options.Add(new TempestProxy()); * return options; * } * if (Zealot.Get().DetectedPreviously * && StrategyAnalysis.CannonRush.Get().DetectedPreviously * && Oracle.Get().DetectedPreviously * && Phoenix.Get().DetectedPreviously * && Stalker.Get().DetectedPreviously * && !Immortal.Get().DetectedPreviously) * { * //Gumby * options.Add(new NinjaTurtles()); * return options; * } * if (Oracle.Get().DetectedPreviously) * { * options.Add(new OneBaseTempest()); * return options; * } * if (!Stalker.Get().DetectedPreviously * && !Zealot.Get().DetectedPreviously * && !Sentry.Get().DetectedPreviously) * { * options.Add(new ZealotRush()); * return options; * } * if (Zealot.Get().DetectedPreviously * && !Stalker.Get().DetectedPreviously) * { * options.Add(new NinjaTurtles()); * return options; * } * * options.Add(new NinjaTurtles()); * options.Add(new PvPMothershipSiege()); */ } return(options); }