Interface CampaignEventPlugin

All Superinterfaces:
CallEvent.CallableEvent
All Known Implementing Classes:
BaseEventPlugin, CivilDisorder, FactionHostilityEvent, FleetLogEvent, FoodShortageEvent, InvestigationEvent, InvestigationEventCommSniffer, InvestigationEventGoodRepWithOther, InvestigationEventSmugglingV2, NearbyEventsEvent, OfficerManagerEvent, RecentUnrestEvent, RepTrackerEvent, TestEvent, TradeInfoUpdateEvent, TutorialMissionEvent

public interface CampaignEventPlugin extends CallEvent.CallableEvent
  • Method Details

    • getId

      String getId()
      Unique ID for this instance of the event.
      Returns:
    • init

      void init(String eventType, CampaignEventTarget eventTarget)
      Called when the EventProbability for this event is accessed. Doesn't mean the event will actually happen.
      Parameters:
      eventType -
      eventTarget -
    • cleanup

      void cleanup()
      Called when this instance of the event is removed from the event manager (either due to event being over, or due to event probability dropping to 0).
    • setProbability

      void setProbability(float p)
      The probability that the event had of happening, set right before startEvent() is called. Set to 1 by events started using CampaignEventManagerAPI.startEvent().
      Parameters:
      p -
    • startEvent

      void startEvent()
      Called when the event starts.
    • advance

      void advance(float amount)
    • isDone

      boolean isDone()
    • getEventTarget

      CampaignEventTarget getEventTarget()
    • getEventType

      String getEventType()
    • getTokenReplacements

      Map<String,String> getTokenReplacements()
      Token values for filling out descriptions from reports.csv.
      Returns:
    • getHighlights

      String[] getHighlights(String stageId)
      Since multiple reports (possibly from different channels) are possible per stage: 1) All reports must have the highlighted text occur in the same order, which is the order this method returns them in, and 2) Not all highlights have to occur in every report.
      Parameters:
      stageId -
      Returns:
    • getHighlightColors

      Color[] getHighlightColors(String stageId)
      Since multiple reports (possibly from different channels) are possible per stage: 1) All reports must have the highlighted text occur in the same order, which is the order this method returns them in, and 2) Not all highlights have to occur in every report.
      Parameters:
      stageId -
      Returns:
    • getStageIdForPossible

      String getStageIdForPossible()
      event_stage for when the event is possible, but hasn't happened yet.
      Returns:
    • getWarningWhenPossiblePriority

      MessagePriority getWarningWhenPossiblePriority()
      Message priority for the "event is possible" report.
      Returns:
    • getStageIdForLikely

      String getStageIdForLikely()
      event_stage for when the event is likely, but hasn't happened yet.
      Returns:
    • getWarningWhenLikelyPriority

      MessagePriority getWarningWhenLikelyPriority()
      Message priority for the "event is likely" report.
      Returns:
    • setParam

      void setParam(Object param)
      Only called when an event is started via CampaignEventManagerAPI.startEvent().
      Parameters:
      param -
    • allowMultipleOngoingForSameTarget

      @Deprecated boolean allowMultipleOngoingForSameTarget()
      Deprecated.
      DO NOT USE, DOES NOT WORK. Should always return false.
      Returns:
    • getEventName

      String getEventName()
    • useEventNameAsId

      boolean useEventNameAsId()
    • getEventCategory

    • getRelatedCommodities

      List<String> getRelatedCommodities()
    • getPriceUpdates

    • getCurrentMessageIcon

      String getCurrentMessageIcon()
      Will be called by SectorAPI.reportEventStage(). Can change between calls. The priority for icons is: 1) Icon configured in reports.csv for the specific report 2) Return value of this method 3) Event's icon (via getEventIcon() and then from events.json) 4) Channel's icon, if message isn't related to an event or the event has no icon.
      Returns:
    • getCurrentImage

      String getCurrentImage()
      The larger image in the message detail.
      Returns:
    • getEventIcon

      String getEventIcon()
      Override for the "image" normally specified in events.json. Small.
      Returns:
    • showAllMessagesIfOngoing

      boolean showAllMessagesIfOngoing()
      If true, messages for an ongoing event will be shown in the intel UI even if they don't meet the "last week/month/cycle" criteria.
      Returns:
    • callEvent

      boolean callEvent(String ruleId, InteractionDialogAPI dialog, List<Misc.Token> params, Map<String,MemoryAPI> memoryMap)
      Called by the CallEvent command (called from rules.csv).
      Specified by:
      callEvent in interface CallEvent.CallableEvent
      Parameters:
      memoryMap -
      params -
    • getMemory

      MemoryAPI getMemory()
    • showLatestMessageIfOngoing

      boolean showLatestMessageIfOngoing()