protected override bool PerformEquipmentAction(EquipmentSlot slot) { if (!slot.characterBody || !slot.characterBody.teamComponent) { return(false); } var ctrlInst = UnityEngine.Object.Instantiate(snowglobeControllerPrefab, slot.characterBody.corePosition, Quaternion.identity); ctrlInst.GetComponent <SnowglobeController>().myTeam = slot.characterBody.teamComponent.teamIndex; var boost = Embryo.CheckLastEmbryoProc(slot.characterBody, equipmentDef) + 1; ctrlInst.GetComponent <SnowglobeController>().remainingTicks *= boost; ctrlInst.GetComponentInChildren <PostProcessDuration>().maxDuration *= boost; NetworkServer.Spawn(ctrlInst); return(true); }
protected override bool PerformEquipmentAction(EquipmentSlot slot) { var sloc = slot.characterBody?.skillLocator; if (!sloc) { return(false); } int count = 1 + Embryo.CheckLastEmbryoProc(slot, equipmentDef); for (var i = 0; i < count; i++) { sloc.ApplyAmmoPack(); } return(true); }
/*private void Evt_ConfigEntryChanged(object sender, AutoUpdateEventArgs args) { * if(args.changedProperty.Name == nameof(duration)) { * } * }*///TODO: update buff timers. will require a lot of reflection protected override bool PerformEquipmentAction(EquipmentSlot slot) { var sbdy = slot.characterBody; if (!sbdy) { return(false); } sbdy.ClearTimedBuffs(pillageBuff); var count = Embryo.CheckLastEmbryoProc(slot, equipmentDef) + 1; for (var i = 0; i < count; i++) { sbdy.AddTimedBuff(pillageBuff, duration); } return(true); }
protected override bool PerformEquipmentAction(EquipmentSlot slot) { if (!slot.characterBody) { return(false); } if (SceneCatalog.mostRecentSceneDef.baseSceneName == "bazaar") { return(false); } bool succeeded = false; int count = 1 + Embryo.CheckLastEmbryoProc(slot, equipmentDef); for (var i = 0; i < count; i++) { succeeded |= TrySpawnChest(slot.characterBody.transform); } return(succeeded); }
public override void SetupBehavior() { base.SetupBehavior(); broochPrefab = UnityEngine.Object.Instantiate(LegacyResourcesAPI.Load <InteractableSpawnCard>("SpawnCards/InteractableSpawnCard/iscChest1")); broochPrefab.directorCreditCost = 0; broochPrefab.sendOverNetwork = true; broochPrefab.skipSpawnWhenSacrificeArtifactEnabled = false; broochPrefab.prefab = PrefabAPI.InstantiateClone(broochPrefab.prefab, "chestBrooch", true); broochPrefab.prefab.AddComponent <CaptainsBroochDroppod>().enabled = !safeMode; var pInt = broochPrefab.prefab.GetComponent <PurchaseInteraction>(); baseCost = pInt.cost; pInt.cost = Mathf.CeilToInt(baseCost * (1f + extraCost)); pInt.automaticallyScaleCostWithDifficulty = true; Embryo.RegisterHook(this.equipmentDef, "EMBRYO_DESC_APPEND_RETRIGGER", () => "CI.CaptainsBrooch"); }
protected override bool PerformEquipmentAction(EquipmentSlot slot) { if (!slot.characterBody) { return(false); } if (SceneCatalog.mostRecentSceneDef.baseSceneName == "bazaar") { return(false); } var sphpos = slot.characterBody.transform.position; var sphrad = radius; sphrad *= Embryo.CheckLastEmbryoProc(slot.characterBody, equipmentDef) + 1; Collider[] sphits = Physics.OverlapSphere(sphpos, sphrad, LayerIndex.defaultLayer.mask, QueryTriggerInteraction.Collide); bool foundAny = false; foreach (Collider c in sphits) { var ent = EntityLocator.GetEntity(c.gameObject); if (!ent) { continue; } var cptChest = ent.GetComponent <ChestBehavior>(); if (!cptChest) { continue; } var cptPurch = ent.GetComponent <PurchaseInteraction>(); if (cptPurch && cptPurch.available && cptPurch.costType == CostTypeIndex.Money) { cptPurch.SetAvailable(false); cptChest.Open(); foundAny = true; } } return(foundAny); }
public override void SetupBehavior() { base.SetupBehavior(); Embryo.RegisterHook(this.equipmentDef, "EMBRYO_DESC_APPEND_AMETHYST", () => "CI.GiganticAmethyst"); }
public override void SetupBehavior() { base.SetupBehavior(); Embryo.RegisterHook(this.equipmentDef, "EMBRYO_DESC_APPEND_RETRIGGER", () => "CI.PillagedGold"); }
public override void SetupBehavior() { base.SetupBehavior(); Embryo.RegisterHook(this.equipmentDef, "EMBRYO_DESC_APPEND_SNOWGLOBE", () => "CI.Snowglobe"); }
public override void SetupBehavior() { base.SetupBehavior(); Embryo.RegisterHook(this.equipmentDef, "EMBRYO_DESC_APPEND_SKELETONKEY", () => "CI.SkeletonKey"); }