| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- using UnityEngine;
- /// <summary>
- /// A spottable skeleton patrol event that appears as a red marker within perception range
- /// Players can choose to approach and engage or avoid the patrol
- /// </summary>
- [CreateAssetMenu(fileName = "SpottableSkeletonPatrol", menuName = "RPG/Travel Events/Spottable/Skeleton Patrol")]
- public class SpottableSkeletonPatrol : CombatTravelEvent
- {
- [Header("Spottable Event Settings")]
- [TextArea(2, 4)]
- public string[] spotDescription = {
- "You spot skeletal figures moving in the distance...",
- "A patrol of undead warriors can be seen ahead...",
- "Your keen eyes detect a group of skeleton warriors patrolling the area..."
- };
- void OnEnable()
- {
- // Configure as spottable event
- triggerType = EventTriggerType.Spottable;
- // Set up the event details
- eventName = "Skeleton Patrol";
- eventDescription = "A patrol of skeleton warriors guards this area. They haven't noticed you yet.";
- eventType = EventType.Combat;
- rarity = EventRarity.Common;
- // Configure combat settings
- minEnemies = 2;
- maxEnemies = 4;
- allowRunningAway = true;
- runAwaySuccessChance = 0.85f; // Higher chance since you can see them coming
- runAwayHealthPenalty = 2; // Lower penalty since you're prepared
- // Set terrain preferences (skeletons prefer ruins, forests, mountains)
- plainsChance = 0.4f;
- forestChance = 0.8f;
- mountainChance = 0.7f;
- roadChance = 0.3f; // Less likely on roads
- townChance = 0.1f; // Very unlikely in settlements
- villageChance = 0.2f;
- // Configure encounter descriptions
- encounterDescriptions = new string[]
- {
- "The skeleton patrol notices your approach and readies their weapons!",
- "The undead warriors turn toward you with hollow, glowing eyes!",
- "The skeleton patrol forms a battle line as you draw near!"
- };
- // Configure escape messages for spotted encounters
- successfulRunAwayMessages = new string[]
- {
- "Having spotted them first, your party easily retreats unnoticed!",
- "Your party backs away quietly before the patrol spots you!",
- "You successfully avoid the skeleton patrol by taking a different route!"
- };
- failedRunAwayMessages = new string[]
- {
- "The skeletons spot your retreat! You take {damage} damage as they give chase!",
- "Your withdrawal is noticed! The patrol pursues, dealing {damage} damage!",
- "The undead patrol catches up to your fleeing party for {damage} damage!"
- };
- }
- public override EventResult ExecuteEvent(TravelEventContext context)
- {
- // Show spot description first
- string description = spotDescription[Random.Range(0, spotDescription.Length)];
- // Then execute as normal combat event
- return base.ExecuteEvent(context);
- }
- /// <summary>
- /// Provides a description of what the team spotted
- /// </summary>
- public string GetSpotDescription()
- {
- return spotDescription[Random.Range(0, spotDescription.Length)];
- }
- }
|