예제 #1
0
 public static void Postfix(PlayerControl __instance)
 {
     if (__instance != null)
     {
         if (RoleInfo.IsRole(__instance, Roles.Snitch))
         {
             // Update where the snitch's arrows are pointing
             List <VisualArrow> currentArrows = VisualArrow.GetArrows(RoleInfo.SNITCH_CHILD_ID);
             if (currentArrows.Count > 0)
             {
                 int index = 0;
                 foreach (PlayerControl player in PlayerControl.AllPlayerControls)
                 {
                     if (player.Data.IsImpostor && !player.Data.IsDead)
                     {
                         currentArrows[index++].ChangeTarget(player.transform.position);
                     }
                 }
             }
         }
         if (__instance.Data.IsImpostor)
         {
             // Update where the impostor's arrow is pointing
             List <VisualArrow> currentArrows = VisualArrow.GetArrows(RoleInfo.IMPOSTOR_CHILD_ID);
             PlayerControl      snitch        = RoleInfo.GetControlForRole(Roles.Snitch);
             if (currentArrows.Count > 0 && snitch != null && !snitch.Data.IsDead)
             {
                 currentArrows.First().ChangeTarget(snitch.transform.position);
             }
         }
     }
 }
 public static void Postfix(PlayerControl __instance, [HarmonyArgument(0)] uint index)
 {
     if (RoleInfo.IsRole(__instance, Roles.Snitch))
     {
         int tasksLeft = __instance.myTasks.ToArray().ToList()
                         .Where(x => !x.IsComplete).Count();
         if (tasksLeft == 1 && PlayerControl.LocalPlayer.Data.IsImpostor)
         {
             // Add an arrow to the snitch for the impostor(s)
             VisualArrow.Create(__instance.transform.position, RoleInfo.IMPOSTOR_CHILD_ID);
             // Put in task list that the snitch can see them soon
             ImportantTextTask importantTask = new GameObject("Impostor Snitch Notif").AddComponent <ImportantTextTask>();
             importantTask.transform.SetParent(PlayerControl.LocalPlayer.transform, false);
             importantTask.Text = RoleInfo.HighlightHex + __instance.name + " is the Snitch![]";
             PlayerControl.LocalPlayer.myTasks.Insert(0, importantTask);
         }
         else if (tasksLeft == 0 && RoleInfo.IsRole(PlayerControl.LocalPlayer, Roles.Snitch))
         {
             //System.Console.WriteLine("Adding arrow to impostor!");
             // Add arrows to the impostors
             foreach (PlayerControl player in PlayerControl.AllPlayerControls)
             {
                 if (player.Data.IsImpostor && !player.Data.IsDead)
                 {
                     VisualArrow.Create(player.transform.position, RoleInfo.SNITCH_CHILD_ID);
                 }
             }
             // Put in the task list that they can now see the impostors
             ImportantTextTask importantTask = new GameObject("Snitch Notif").AddComponent <ImportantTextTask>();
             importantTask.transform.SetParent(__instance.transform, false);
             importantTask.Text = RoleInfo.HighlightHex + "Your arrows point to the Impostors![]";
             __instance.myTasks.Insert(0, importantTask);
         }
     }
 }
        public static void Postfix(EndGameManager __instance)
        {
            OverrideScreen(__instance, true);

            RoleInfo.JesterId      = RoleInfo.WitnessId = RoleInfo.SnitchId = RoleInfo.MechanicId =
                RoleInfo.SheriffId = 255;
            VisualArrow.ClearArrows();
        }
예제 #4
0
    public override void Use()
    {
        Vector3     tArrowPos    = m_pUser.Position + (m_pUser.Forward.normalized * 2.0f) + Vector3.up;
        Arrow       pArrow       = new Arrow(tArrowPos, m_pUser.Forward, m_pUser.Atk + m_iAtk, m_fRange, m_pUser.CharSide);
        VisualArrow pVisualArrow = GameObject.Instantiate(s_pArrowRef, tArrowPos, Quaternion.identity) as VisualArrow;          // I know this should go in a VisualBow.cs but as it would be for one line, I figured it's forgetable, this time

        pVisualArrow.ArrowBUS = pArrow;
    }
예제 #5
0
 public static void S_BowInitialize()
 {
     s_pBowRef = Resources.Load<GameObject>("Heroes/Weapons/Bow");
     s_pBowIconRef = Resources.Load<GameObject>("HUD/ItemIcons/BowIcon");
     s_pArrowRef = Resources.Load<VisualArrow>("Heroes/Weapons/Arrow");
 }
예제 #6
0
 static public void S_BowInitialize()
 {
     s_pBowRef     = Resources.Load <GameObject>("Heroes/Weapons/Bow");
     s_pBowIconRef = Resources.Load <GameObject>("HUD/ItemIcons/BowIcon");
     s_pArrowRef   = Resources.Load <VisualArrow>("Heroes/Weapons/Arrow");
 }