// Overrides public override void PostDraw() { base.PostDraw(); if (drawUnderlay) { float opacity = GfxEffects.VanillaPulse(parent); // (1 - value) bc we want to rotate counter clockwise float angle = (1 - GfxEffects.LoopAroundOneSuperSlow(parent)) * 360; GfxEffects.DrawTickRotating(parent, underlayMat, 0, 0, 2 * Range, angle, opacity, GfxEffects.Layer.under, false); } if (drawOverlay) { float opacity = GfxEffects.PulseFactorOne(parent); float angle = 0f; if (IsFlaySpot) { //clockwise angle = GfxEffects.LoopAroundOneNormal(parent) * 360; } else { //anticlockwise angle = (1 - GfxEffects.LoopAroundOneNormal(parent)) * 360; } GfxEffects.DrawTickRotating(parent, overlayMat, 0, 0, 2 * Range, angle, opacity, GfxEffects.Layer.under, false); } }
public override void CompTickRare() { base.CompTickRare(); //Applying torment List <Pawn> affectedPawnList = new List <Pawn> { }; affectedPawnList = ToolsCell.GetPawnsInRadius( buildingPos.ToIntVec3(), Range, myMap, Props.affectsAnimals, Props.affectsHumanlike, Props.affectsMechanoids, Props.affectsColonists, Props.affectsNeutralOrFriends, Props.affectsEnemies, prcDebug ); foreach (Pawn curPawn in affectedPawnList) { // Slugs are immune to this if (curPawn.IsSlug()) { Tools.Warn(curPawn.Label + " is slug, not affected", prcDebug); continue; } // Add psychicSensitivity * SocialImpact * SocialSkill fight here if (ToolsBodyPart.ApplyHediffOnBodyPartTag(curPawn, BodyPartTagDefOf.ConsciousnessSource, hediffDefToApply, prcDebug)) { if (IsFlaySpot) { Thought_Memory MindFlayed = (Thought_Memory)ThoughtMaker.MakeThought(MyDefs.MindFlayThought); curPawn.needs.mood.thoughts.memories.TryGainMemory(MindFlayed, Initiator); } //GfxEffects.ThrowPsycastAreaMote(curPawn.Position.ToVector3(), myMap); GfxEffects.ThrowMindMote(curPawn.Position.ToVector3(), myMap, spotKind); AffectedPawnsNum++; } } if (IsLimitExceeded) { Initiator.ApplyTiredness(); } //Checking if Initiator is not mad or downed or sleepin or on fire if (Initiator.InMentalState || Initiator.Downed || Initiator.IsSleepingOrOnFire() || AffectedPawnsNum > Props.hediffAppliedLimit) { GfxEffects.ThrowCoupleMotes(buildingPos, myMap, spotKind); building.Destroy(); } }
public static Thing CreateMindSpot(IntVec3 destinationCell, Map map, MyDefs.SpotKind spotKind) { ThingDef thingDef = null; if (spotKind == MyDefs.SpotKind.flay) { thingDef = MyDefs.MindFlaySpotThingDef; } else if (spotKind == MyDefs.SpotKind.fondle) { thingDef = MyDefs.MindFondleSpotThingDef; } else { Tools.Warn("CreateMindSpot - bad spotkind", true); } Building mindFlaySpot = (Building)ThingMaker.MakeThing(thingDef, null); //lockBlock.SetColor(lockDowner.DrawColor); GenSpawn.Spawn(mindFlaySpot, destinationCell, map, Rot4.North, WipeMode.Vanish); mindFlaySpot.SetFaction(Faction.OfPlayer); GfxEffects.ThrowCoupleMotes(destinationCell.ToVector3(), map, spotKind); foreach (IntVec3 puff in GenAdj.CellsAdjacent8Way(mindFlaySpot)) { if (puff.InBounds(map)) { MoteMaker.ThrowAirPuffUp(puff.ToVector3(), map); } } return(mindFlaySpot); }
private void SetClosestColor() { closestColor = GfxEffects.ClosestColor(building, myDebug); }