diff --git a/src/bin/main.rs b/src/bin/main.rs
index 3195373..eb7c687 100644
--- a/src/bin/main.rs
+++ b/src/bin/main.rs
@@ -5,7 +5,7 @@ use elseware::common::interserver::AuthToken;
use elseware::login::login::LoginServerState;
use elseware::login::character::CharacterServerState;
use elseware::patch::patch::{PatchServerState, generate_patch_tree, load_config, load_motd};
-use elseware::ship::ship::ShipServerStateBuilder;
+use elseware::ship::ship::{ShipServerStateBuilder, ShipEvent};
#[allow(unused_imports)]
use elseware::entity::gateway::{EntityGateway, InMemoryGateway, PostgresGateway};
@@ -364,6 +364,7 @@ fn main() {
.name("US/Sona-Nyl".into())
.ip(Ipv4Addr::new(127,0,0,1))
.port(elseware::ship::ship::SHIP_PORT)
+ .event(ShipEvent::Halloween)
.gateway(entity_gateway.clone())
.build();
let sub_ship_state = ship_state.clone();
@@ -378,7 +379,8 @@ fn main() {
let ship_state = ShipServerStateBuilder::default()
.name("EU/Dylath-Leen".into())
.ip(Ipv4Addr::new(127,0,0,1))
- .port(elseware::ship::ship::SHIP_PORT+200)
+ .port(elseware::ship::ship::SHIP_PORT+2000)
+ .event(ShipEvent::Christmas)
.gateway(entity_gateway.clone())
.build();
let sub_ship_state = ship_state.clone();
diff --git a/src/ship/map/enemy.rs b/src/ship/map/enemy.rs
index 0903c57..79dc3b8 100644
--- a/src/ship/map/enemy.rs
+++ b/src/ship/map/enemy.rs
@@ -5,6 +5,7 @@ use std::collections::HashMap;
use byteorder::{LittleEndian, ReadBytesExt};
use thiserror::Error;
+use crate::ship::ship::ShipEvent;
use crate::ship::monster::MonsterType;
use crate::ship::room::Episode;
@@ -335,21 +336,24 @@ impl MapEnemy {
guaranteed rare monsters don't count towards the limit
*/
#[must_use]
- pub fn into_rare(self) -> MapEnemy {
- match (self.monster, self.map_area.to_episode()) {
- (MonsterType::RagRappy, Episode::One) => {MapEnemy {monster: MonsterType::AlRappy, shiny:true, ..self}},
- (MonsterType::RagRappy, Episode::Two) => {MapEnemy {monster: MonsterType::LoveRappy, shiny:true, ..self}},
- (MonsterType::Hildebear, _) => {MapEnemy {monster: MonsterType::Hildeblue, shiny:true, ..self}},
- (MonsterType::PoisonLily, _) => {MapEnemy {monster: MonsterType::NarLily, shiny:true, ..self}},
- (MonsterType::PofuillySlime, _) => {MapEnemy {monster: MonsterType::PouillySlime, shiny:true, ..self}},
- (MonsterType::SandRappyCrater, _) => {MapEnemy {monster: MonsterType::DelRappyCrater, shiny:true, ..self}},
- (MonsterType::ZuCrater, _) => {MapEnemy {monster: MonsterType::PazuzuCrater, shiny:true, ..self}},
- (MonsterType::Dorphon, _) => {MapEnemy {monster: MonsterType::DorphonEclair, shiny:true, ..self}},
- (MonsterType::SandRappyDesert, _) => {MapEnemy {monster: MonsterType::DelRappyDesert, shiny:true, ..self}},
- (MonsterType::ZuDesert, _) => {MapEnemy {monster: MonsterType::PazuzuDesert, shiny:true, ..self}},
- (MonsterType::MerissaA, _) => {MapEnemy {monster: MonsterType::MerissaAA, shiny:true, ..self}},
- (MonsterType::SaintMillion, _) => {MapEnemy {monster: MonsterType::Kondrieu, shiny:true, ..self}},
- (MonsterType::Shambertin, _) => {MapEnemy {monster: MonsterType::Kondrieu, shiny:true, ..self}},
+ pub fn into_rare(self, event: ShipEvent) -> MapEnemy {
+ match (self.monster, self.map_area.to_episode(), event) {
+ (MonsterType::RagRappy, Episode::One, _) => {MapEnemy {monster: MonsterType::AlRappy, shiny:true, ..self}},
+ (MonsterType::RagRappy, Episode::Two, ShipEvent::Easter) => {MapEnemy {monster: MonsterType::EasterRappy, shiny:true, ..self}},
+ (MonsterType::RagRappy, Episode::Two, ShipEvent::Halloween) => {MapEnemy {monster: MonsterType::HalloRappy, shiny:true, ..self}},
+ (MonsterType::RagRappy, Episode::Two, ShipEvent::Christmas) => {MapEnemy {monster: MonsterType::StRappy, shiny:true, ..self}},
+ (MonsterType::RagRappy, Episode::Two, _) => {MapEnemy {monster: MonsterType::LoveRappy, shiny:true, ..self}},
+ (MonsterType::Hildebear, _, _) => {MapEnemy {monster: MonsterType::Hildeblue, shiny:true, ..self}},
+ (MonsterType::PoisonLily, _, _) => {MapEnemy {monster: MonsterType::NarLily, shiny:true, ..self}},
+ (MonsterType::PofuillySlime, _, _) => {MapEnemy {monster: MonsterType::PouillySlime, shiny:true, ..self}},
+ (MonsterType::SandRappyCrater, _, _) => {MapEnemy {monster: MonsterType::DelRappyCrater, shiny:true, ..self}},
+ (MonsterType::ZuCrater, _, _) => {MapEnemy {monster: MonsterType::PazuzuCrater, shiny:true, ..self}},
+ (MonsterType::Dorphon, _, _) => {MapEnemy {monster: MonsterType::DorphonEclair, shiny:true, ..self}},
+ (MonsterType::SandRappyDesert, _, _) => {MapEnemy {monster: MonsterType::DelRappyDesert, shiny:true, ..self}},
+ (MonsterType::ZuDesert, _, _) => {MapEnemy {monster: MonsterType::PazuzuDesert, shiny:true, ..self}},
+ (MonsterType::MerissaA, _, _) => {MapEnemy {monster: MonsterType::MerissaAA, shiny:true, ..self}},
+ (MonsterType::SaintMillion, _, _) => {MapEnemy {monster: MonsterType::Kondrieu, shiny:true, ..self}},
+ (MonsterType::Shambertin, _, _) => {MapEnemy {monster: MonsterType::Kondrieu, shiny:true, ..self}},
_ => {self},
}
}
diff --git a/src/ship/map/maps.rs b/src/ship/map/maps.rs
index febfa44..6eb5be3 100644
--- a/src/ship/map/maps.rs
+++ b/src/ship/map/maps.rs
@@ -6,6 +6,7 @@ use std::fs::File;
use thiserror::Error;
+use crate::ship::ship::ShipEvent;
use crate::ship::monster::MonsterType;
use crate::ship::room::{Episode, RoomMode};
@@ -186,7 +187,7 @@ pub struct Maps {
}
impl Maps {
- pub fn new(room_mode: RoomMode, rare_monster_table: &enemy::RareMonsterAppearTable) -> Maps {
+ pub fn new(room_mode: RoomMode, rare_monster_table: &enemy::RareMonsterAppearTable, event: ShipEvent) -> Maps {
let map_variants = match (room_mode.episode(), room_mode.single_player()) {
(Episode::One, 0) => {
vec![MapVariant::new(MapArea::Pioneer2Ep1, MapVariantMode::Online),
@@ -284,7 +285,7 @@ impl Maps {
enemy_data_from_map_data(map_variant, &room_mode.episode())
})
.flatten()
- .map(|enemy| apply_rare_enemy(enemy, rare_monster_table))
+ .map(|enemy| apply_rare_enemy(enemy, rare_monster_table, event))
.collect(),
object_data: map_variants.iter()
.flat_map(|map_variant| {
@@ -314,10 +315,15 @@ impl Maps {
})
}
- pub fn set_quest_data(&mut self, enemies: Vec