Exemplo n.º 1
0
 public static GuardSettings GetGuardSettings()
 {
     if (CachedSettings == null)
     {
         GuardSettings set = new GuardSettings();
         set.cooldownMissingItem     = 1.5f;
         set.cooldownSearchingTarget = 0.5f;
         set.cooldownShot            = 5f;
         set.range           = 20;
         set.recruitmentItem = new InventoryItem(BuiltinBlocks.Bow);
         set.shootItem       = new List <InventoryItem>()
         {
             new InventoryItem(BuiltinBlocks.BronzeArrow)
         };
         set.shootDamage       = 100f;
         set.sleepSafetyPeriod = 1f;
         set.sleepType         = EGuardSleepType.Night;
         set.typeXN            = BuiltinBlocks.GuardBowJobDayXN;
         set.typeXP            = BuiltinBlocks.GuardBowJobDayXP;
         set.typeZN            = BuiltinBlocks.GuardBowJobDayZN;
         set.typeZP            = BuiltinBlocks.GuardBowJobDayZP;
         set.OnShootAudio      = "bowShoot";
         set.OnHitAudio        = "fleshHit";
         CachedSettings        = set;
     }
     return(CachedSettings);
 }
Exemplo n.º 2
0
 public static GuardSettings GetGuardSettings()
 {
     if (CachedSettings == null)
     {
         GuardSettings set = new GuardSettings();
         set.cooldownMissingItem     = 1.5f;
         set.cooldownSearchingTarget = 0.5f;
         set.cooldownShot            = 12f;
         set.range           = 30;
         set.recruitmentItem = new InventoryItem(BuiltinBlocks.MatchlockGun);
         set.shootItem       = new List <InventoryItem>()
         {
             new InventoryItem(BuiltinBlocks.LeadBullet), new InventoryItem(BuiltinBlocks.GunpowderPouch)
         };
         set.shootDamage       = 500f;
         set.sleepSafetyPeriod = 1f;
         set.sleepType         = EGuardSleepType.Day;
         set.typeXN            = BuiltinBlocks.GuardMatchlockJobNightXN;
         set.typeXP            = BuiltinBlocks.GuardMatchlockJobNightXP;
         set.typeZN            = BuiltinBlocks.GuardMatchlockJobNightZN;
         set.typeZP            = BuiltinBlocks.GuardMatchlockJobNightZP;
         set.OnShootAudio      = "matchlock";
         set.OnHitAudio        = "fleshHit";
         CachedSettings        = set;
     }
     return(CachedSettings);
 }
Exemplo n.º 3
0
 public static GuardSettings GetGuardSettings()
 {
     if (CachedSettings == null)
     {
         GuardSettings set = new GuardSettings();
         set.cooldownMissingItem     = 1.5f;
         set.cooldownSearchingTarget = 0.5f;
         set.cooldownShot            = 3f;
         set.range           = 12;
         set.recruitmentItem = new InventoryItem(BuiltinBlocks.Sling);
         set.shootItem       = new List <InventoryItem>()
         {
             new InventoryItem(BuiltinBlocks.SlingBullet)
         };
         set.shootDamage       = 50f;
         set.sleepSafetyPeriod = 1f;
         set.sleepType         = EGuardSleepType.Day;
         set.typeXN            = BuiltinBlocks.GuardSlingerJobNightXN;
         set.typeXP            = BuiltinBlocks.GuardSlingerJobNightXP;
         set.typeZN            = BuiltinBlocks.GuardSlingerJobNightZN;
         set.typeZP            = BuiltinBlocks.GuardSlingerJobNightZP;
         set.OnShootAudio      = "sling";
         set.OnHitAudio        = "fleshHit";
         CachedSettings        = set;
     }
     return(CachedSettings);
 }
Exemplo n.º 4
0
 public ITrackableBlock InitializeOnAdd(Vector3Int position, ushort type, Players.Player player)
 {
     InitializeJob(player, position, 0);
     if (guardSettings == null)
     {
         guardSettings = SetupSettings();
     }
     return(this);
 }
Exemplo n.º 5
0
 public override ITrackableBlock InitializeFromJSON(Players.Player player, JSONNode node)
 {
     InitializeJob(player, (Vector3Int)node["position"], node.GetAs <int>("npcID"));
     if (guardSettings == null)
     {
         guardSettings = SetupSettings();
     }
     return(this);
 }
Exemplo n.º 6
0
 public override ITrackableBlock InitializeFromJSON(Players.Player player, JSONNode node)
 {
     blockType = ItemTypes.IndexLookup.GetIndex(node.GetAs <string>("type"));
     InitializeJob(player, (Vector3Int)node["position"], node.GetAs <int>("npcID"));
     if (guardSettings == null)
     {
         guardSettings = SetupSettings();
     }
     return(this);
 }
Exemplo n.º 7
0
 protected override bool IsValidWorldType(ushort type)
 {
     if (guardSettings == null)
     {
         guardSettings = SetupSettings();
     }
     return(type == guardSettings.typeXP ||
            type == guardSettings.typeXN ||
            type == guardSettings.typeZP ||
            type == guardSettings.typeZN);
 }