// Token: 0x060000DF RID: 223 RVA: 0x000056E4 File Offset: 0x000038E4
        public List <Toil> RequestPlayToils(Pawn pawn, Building_Performance stage)
        {
            if (lToils == null || lToils.Count == 0)
            {
                this.stage = stage;
                ConstructPlay();
            }
            if (((Lead != null && !Lead.Dead) || pawn == Support) && (Support == null || Support.Dead))
            {
                Pawn lead = Lead;
            }
            List <Toil> result;

            if (pawn == Lead)
            {
                result = lToils;
            }
            else if (pawn == Support)
            {
                result = sToils;
            }
            else
            {
                result = new List <Toil>();
            }
            return(result);
        }
        // Token: 0x060000E3 RID: 227 RVA: 0x000058A8 File Offset: 0x00003AA8
        public Toil GoToStageLocation(Building_Performance stage, RazzleDazzle_Director.StageLocations loc)
        {
            Toil toil = Toils_Goto.GotoCell(GetStageCell(loc, stage), PathEndMode.OnCell);

            toil.tickAction = delegate()
            {
                stage.ticksIntoThisPerformance++;
            };
            return(toil);
        }
 // Token: 0x060000E6 RID: 230 RVA: 0x00005B80 File Offset: 0x00003D80
 public void Comedy(List <Toil> leadToils, List <Toil> supportToils, Building_Performance stage)
 {
     leadToils.Add(GoToStageLocation(stage, StageLocations.DOWNSTAGE_R));
     supportToils.Add(GoToStageLocation(stage, StageLocations.DOWNSTAGE_L));
     leadToils.Add(Synchronise());
     supportToils.Add(Synchronise());
     leadToils.Add(GoToStageLocation(stage, StageLocations.STAGE_C));
     supportToils.Add(GoToStageLocation(stage, StageLocations.STAGE_C));
     leadToils.Add(Synchronise());
     supportToils.Add(Synchronise());
     leadToils.Add(GoToStageLocation(stage, StageLocations.DOWNSTAGE_L));
     leadToils.Add(Synchronise());
     supportToils.Add(Synchronise());
     leadToils.Add(ThrowDramaticMote(Lead, ThingDefOf_RazzleDazzle.Mote_Comedy, 401));
     leadToils.Add(ThrowDramaticMote(Support, ThingDefOf_RazzleDazzle.Mote_Tragedy, 271));
     leadToils.Add(Synchronise());
     supportToils.Add(Synchronise());
 }
        // Token: 0x060000F2 RID: 242 RVA: 0x000062C8 File Offset: 0x000044C8
        private Job ChooseArtAndCarryItJob(Pawn pawn, Building_Performance giver)
        {
            correctArt.Clear();
            Job result;

            if (!TryFindBestArt(giver, pawn, out Thing t))
            {
                result = null;
            }
            else
            {
                result = new Job(JobDefOfRazzleDazzle.JobDef_DoRehearsePlayBill, giver, t)
                {
                    targetB  = t,
                    count    = 1,
                    haulMode = HaulMode.ToCellNonStorage
                };
            }
            return(result);
        }
 // Token: 0x060000E5 RID: 229 RVA: 0x00005A3C File Offset: 0x00003C3C
 public void Tragedy(List <Toil> leadToils, List <Toil> supportToils, Building_Performance stage)
 {
     leadToils.Add(GoToStageLocation(stage, StageLocations.DOWNSTAGE_C));
     supportToils.Add(GoToStageLocation(stage, StageLocations.UPSTAGE_L));
     leadToils.Add(Synchronise());
     supportToils.Add(Synchronise());
     leadToils.Add(ThrowDramaticMote(Lead, ThingDefOf_RazzleDazzle.Mote_Tragedy, 201));
     leadToils.Add(GoToStageLocation(stage, StageLocations.DOWNSTAGE_L));
     leadToils.Add(FaceDirection(StageForward));
     leadToils.Add(ThrowDramaticMote(Lead, ThingDefOf_RazzleDazzle.Mote_Tragedy, 401));
     leadToils.Add(GoToStageLocation(stage, StageLocations.DOWNSTAGE_R));
     leadToils.Add(FaceDirection(StageForward));
     leadToils.Add(ThrowDramaticMote(Lead, ThingDefOf_RazzleDazzle.Mote_Tragedy, 251));
     leadToils.Add(Synchronise());
     supportToils.Add(Synchronise());
     supportToils.Add(GoToStageLocation(stage, StageLocations.DOWNSTAGE_L));
     supportToils.Add(FaceDirection(StageRight));
     supportToils.Add(ThrowDramaticMote(Support, ThingDefOf.Mote_Heart, 201));
     leadToils.Add(Synchronise());
     supportToils.Add(Synchronise());
 }
 // Token: 0x060000E7 RID: 231 RVA: 0x00005C6C File Offset: 0x00003E6C
 public void MusicalDance(List <Toil> leadToils, List <Toil> supportToils, Building_Performance stage)
 {
     leadToils.Add(GoToStageLocation(stage, StageLocations.DOWNSTAGE_C));
     leadToils.Add(FaceDirection(StageRight));
     supportToils.Add(GoToStageLocation(stage, StageLocations.DOWNSTAGE_C));
     supportToils.Add(FaceDirection(StageLeft));
     leadToils.Add(Synchronise());
     supportToils.Add(Synchronise());
     leadToils.Add(ThrowDramaticMote(Lead, ThingDefOf_RazzleDazzle.Mote_Music, 401));
     supportToils.Add(ThrowDramaticMote(Support, ThingDefOf_RazzleDazzle.Mote_Music, 401));
     leadToils.Add(Synchronise());
     supportToils.Add(Synchronise());
     leadToils.Add(GoToStageLocation(stage, StageLocations.DOWNSTAGE_L));
     supportToils.Add(GoToStageLocation(stage, StageLocations.DOWNSTAGE_R));
     leadToils.Add(Synchronise());
     supportToils.Add(Synchronise());
     leadToils.Add(ThrowDramaticMote(Lead, ThingDefOf_RazzleDazzle.Mote_Music, 401));
     supportToils.Add(ThrowDramaticMote(Support, ThingDefOf_RazzleDazzle.Mote_Music, 401));
     leadToils.Add(Synchronise());
     supportToils.Add(Synchronise());
     leadToils.Add(GoToStageLocation(stage, StageLocations.UPSTAGE_R));
     supportToils.Add(GoToStageLocation(stage, StageLocations.UPSTAGE_L));
     leadToils.Add(Synchronise());
     supportToils.Add(Synchronise());
     leadToils.Add(ThrowDramaticMote(Lead, ThingDefOf_RazzleDazzle.Mote_Music, 401));
     supportToils.Add(ThrowDramaticMote(Support, ThingDefOf_RazzleDazzle.Mote_Music, 401));
     leadToils.Add(Synchronise());
     supportToils.Add(Synchronise());
     leadToils.Add(GoToStageLocation(stage, StageLocations.DOWNSTAGE_C));
     leadToils.Add(FaceDirection(StageRight));
     supportToils.Add(GoToStageLocation(stage, StageLocations.DOWNSTAGE_C));
     supportToils.Add(FaceDirection(StageLeft));
     leadToils.Add(Synchronise());
     supportToils.Add(Synchronise());
     leadToils.Add(ThrowDramaticMote(Lead, ThingDefOf_RazzleDazzle.Mote_Music, 401));
     supportToils.Add(ThrowDramaticMote(Support, ThingDefOf_RazzleDazzle.Mote_Music, 401));
     leadToils.Add(Synchronise());
     supportToils.Add(Synchronise());
 }
 // Token: 0x060000E4 RID: 228 RVA: 0x000058E8 File Offset: 0x00003AE8
 public void Romance(List <Toil> leadToils, List <Toil> supportToils, Building_Performance stage)
 {
     leadToils.Add(GoToStageLocation(stage, StageLocations.STAGE_L));
     leadToils.Add(FaceDirection(StageRight));
     supportToils.Add(GoToStageLocation(stage, StageLocations.STAGE_R));
     supportToils.Add(FaceDirection(StageLeft));
     leadToils.Add(Synchronise());
     supportToils.Add(Synchronise());
     leadToils.Add(ThrowDramaticMote(Lead, ThingDefOf.Mote_Heart, 401));
     supportToils.Add(Wait(100));
     supportToils.Add(ThrowDramaticMote(Support, ThingDefOf.Mote_Heart, 151));
     leadToils.Add(Synchronise());
     supportToils.Add(Synchronise());
     leadToils.Add(GoToStageLocation(stage, StageLocations.DOWNSTAGE_C));
     supportToils.Add(GoToStageLocation(stage, StageLocations.DOWNSTAGE_C));
     leadToils.Add(FaceDirection(StageRight));
     supportToils.Add(FaceDirection(StageLeft));
     leadToils.Add(ThrowDramaticMote(Lead, ThingDefOf.Mote_Heart, 351));
     supportToils.Add(ThrowDramaticMote(Support, ThingDefOf.Mote_Heart, 351));
     leadToils.Add(Synchronise());
     supportToils.Add(Synchronise());
 }
Exemple #8
0
 // Token: 0x06000080 RID: 128 RVA: 0x00003ED7 File Offset: 0x000020D7
 public LordJob_Performance(Building_Performance venue)
 {
     this.venue = venue;
 }
Exemple #9
0
 // Token: 0x060000BA RID: 186 RVA: 0x00004DC3 File Offset: 0x00002FC3
 public LordToil_EndPerformance(Building_Performance venue)
 {
     this.venue = venue;
 }
 // Token: 0x0600009E RID: 158 RVA: 0x00004874 File Offset: 0x00002A74
 public LordJob_PerformComedySet(Building_Performance venue)
 {
     this.venue = venue;
 }
        // Token: 0x060000F3 RID: 243 RVA: 0x00006320 File Offset: 0x00004520
        private static bool TryFindBestArt(Building_Performance venue, Pawn pawn, out Thing art)
        {
            art = null;
            IntVec3 position      = venue.Position;
            Region  validRegionAt = venue.Map.regionGrid.GetValidRegionAt(position);
            bool    result;

            if (validRegionAt == null)
            {
                result = false;
            }
            else
            {
                var found = false;
                bool validArt(Thing t)
                {
                    return(t.Spawned && !t.IsForbidden(pawn) && (t.Position - pawn.Position).LengthHorizontalSquared < 999 && t.def == venue.VenueDef.artDef && pawn.CanReserve(t, 1, -1, null, false));
                }

                newCorrectArt.Clear();
                bool regionProcessor(Region r)
                {
                    List <Thing> list = r.ListerThings.ThingsMatching(ThingRequest.ForGroup(ThingRequestGroup.HaulableEver));

                    for (var i = 0; i < list.Count; i++)
                    {
                        Thing thing = list[i];
                        if (validArt(thing) && !thing.def.IsMedicine)
                        {
                            newCorrectArt.Add(thing);
                        }
                    }
                    if (newCorrectArt.Count > 0)
                    {
                        int comparison(Thing t1, Thing t2)
                        {
                            var num   = (float)(t1.Position - pawn.Position).LengthHorizontalSquared;
                            var value = (float)(t2.Position - pawn.Position).LengthHorizontalSquared;

                            return(num.CompareTo(value));
                        }

                        newCorrectArt.Sort(comparison);
                        correctArt.AddRange(newCorrectArt);
                        newCorrectArt.Clear();
                        if (correctArt.Count > 0)
                        {
                            found = true;
                            return(true);
                        }
                    }
                    return(false);
                }

                var traverseParams = TraverseParms.For(pawn, Danger.Some, TraverseMode.ByPawn, false);
                bool entryCondition(Region from, Region r)
                {
                    return(r.Allows(traverseParams, false));
                }

                RegionTraverser.BreadthFirstTraverse(validRegionAt, entryCondition, regionProcessor, 999, RegionType.Set_Passable);
                if (found)
                {
                    art    = correctArt[0];
                    result = true;
                }
                else
                {
                    result = false;
                }
            }
            return(result);
        }
 // Token: 0x060000F1 RID: 241 RVA: 0x000062B4 File Offset: 0x000044B4
 private Job AssignRehearsalDirectJob(Pawn pawn, Building_Performance giver)
 {
     return(new Job(JobDefOfRazzleDazzle.JobDef_DoStartRehearsalDirectly, giver));
 }
        // Token: 0x060000E8 RID: 232 RVA: 0x00005ED4 File Offset: 0x000040D4
        public static IntVec3 GetStageCell(RazzleDazzle_Director.StageLocations loc, Building_Performance stage)
        {
            IntVec3 position = stage.Position;
            Rot4    rotation = stage.Rotation;
            var     result   = new IntVec3(position.x, position.y, position.z);

            switch (loc)
            {
            case StageLocations.STAGE_R:
                if (rotation.IsHorizontal)
                {
                    result.z -= 2;
                }
                else
                {
                    result.x -= 2;
                }
                break;

            case StageLocations.STAGE_L:
                if (rotation.IsHorizontal)
                {
                    result.z += 2;
                }
                else
                {
                    result.x += 2;
                }
                break;

            case StageLocations.UPSTAGE_R:
                if (rotation.IsHorizontal)
                {
                    result.z -= 2;
                    result.x--;
                }
                else
                {
                    result.x -= 2;
                    result.z++;
                }
                break;

            case StageLocations.UPSTAGE_L:
                if (rotation.IsHorizontal)
                {
                    result.z += 2;
                    result.x--;
                }
                else
                {
                    result.x += 2;
                    result.z++;
                }
                break;

            case StageLocations.UPSTAGE_C:
                if (rotation.IsHorizontal)
                {
                    result.x--;
                }
                else
                {
                    result.z++;
                }
                break;

            case StageLocations.DOWNSTAGE_R:
                if (rotation.IsHorizontal)
                {
                    result.z -= 2;
                    result.x++;
                }
                else
                {
                    result.x -= 2;
                    result.z--;
                }
                break;

            case StageLocations.DOWNSTAGE_L:
                if (rotation.IsHorizontal)
                {
                    result.z += 2;
                    result.x++;
                }
                else
                {
                    result.x += 2;
                    result.z--;
                }
                break;

            case StageLocations.DOWNSTAGE_C:
                if (rotation.IsHorizontal)
                {
                    result.x++;
                }
                else
                {
                    result.z--;
                }
                break;

            case StageLocations.BACKSTAGE:
                if (rotation.IsHorizontal)
                {
                    result.x += 3;
                }
                else
                {
                    result.z -= 3;
                }
                break;
            }
            return(result);
        }
Exemple #14
0
 // Token: 0x060000C7 RID: 199 RVA: 0x00005047 File Offset: 0x00003247
 public LordToil_SettleForPerformance(Building_Performance venue)
 {
     Venue = venue;
 }