From: TheSaminator Date: Wed, 9 Feb 2022 15:45:05 +0000 (-0500) Subject: Expand manual and other changes X-Git-Url: https://gitweb.starshipfights.net/?a=commitdiff_plain;h=973d9220636079dc0895f7910359bd46b8287ae5;p=starship-fights Expand manual and other changes --- diff --git a/src/commonMain/kotlin/starshipfights/game/ship_factions.kt b/src/commonMain/kotlin/starshipfights/game/ship_factions.kt index b123c78..d18079b 100644 --- a/src/commonMain/kotlin/starshipfights/game/ship_factions.kt +++ b/src/commonMain/kotlin/starshipfights/game/ship_factions.kt @@ -2,7 +2,6 @@ package starshipfights.game import kotlinx.html.TagConsumer import kotlinx.html.p -import kotlinx.html.style enum class Faction( val shortName: String, @@ -10,7 +9,6 @@ enum class Faction( val navyName: String, val polityName: String, val demonymSingular: String, - val demonymPlural: String, val shipPrefix: String, val blurbDesc: TagConsumer<*>.() -> Unit, ) { @@ -20,8 +18,7 @@ enum class Faction( navyName = "Mechyrdian Star Fleet", polityName = "Empire of Mechyrdia", demonymSingular = "Mechyrdian", - demonymPlural = "Mechyrdians", - shipPrefix = "MÉMN ", // Mehurdias Éji Magéstati Nau + shipPrefix = "CMS ", // Ciarstuos Mehurdiasi Štelnau blurbDesc = { p { +"Having spent much of its history coming under threat from oppressive theocracies, invading hordes, and revolutionary insurrections, the Empire of Mechyrdia now enjoys a place in the stars as the foremost power of the galaxy." @@ -29,10 +26,6 @@ enum class Faction( p { +"But things are not so ideal for Mechyrdia. The western menace, the Diadochus Masra Draetsen, threatens to upend this peaceful order and conquer Mechyrdia, to succeed where their predecessors the Arkant Horde had failed. Their new leader, Ogus Khan, has made many connections with the disgraced nations of the galaxy, and will stop at nothing to see Mechyrdia fall." } - p { - style = "text-align:center" - +"Fight for liberty and justice with the Empire of Mechyrdia!" - } }, ), MASRA_DRAETSEN( @@ -40,8 +33,7 @@ enum class Faction( shortNameIsDefinite = true, navyName = "Masra Draetsen Khoy'qan", polityName = "Diadochus Masra Draetsen", - demonymSingular = "Masrian", - demonymPlural = "Masrians", + demonymSingular = "Diadochi", shipPrefix = "", // The Diadochi don't use ship prefixes blurbDesc = { p { @@ -50,10 +42,6 @@ enum class Faction( p { +"But now, one of these Diadochi has come to the forefront: the Diadochus Masra Draetsen. Their new leader, Ogus Khan, has forged alliances with many other oppressed nations and remnant states of the galaxy, and stands ready to begin the true conquest of Mechyrdia! May there be woe to the vanquished!" } - p { - style = "text-align:center" - +"Conquer for glory with the Diadochus Masra Draetsen!" - } }, ), ISARNAREYKK( @@ -62,7 +50,6 @@ enum class Faction( navyName = "Isarnareyksk Styurnamariyn", polityName = "Isarnareyksk Iunta", demonymSingular = "Isarnareyksk", - demonymPlural = "Isarnareykski", shipPrefix = "ISMS ", // Isarnareyksk StyurnaMariyn nu Skyf blurbDesc = { p { @@ -71,10 +58,6 @@ enum class Faction( p { +"Isarnareykk is at a crossroads now. Shall they embrace democracy and join forces with Mechyrdia? Shall they give the Faurasitand a perpetual dictatorship to end the crisis? Or shall one of the Iunta's factions win out: the military reclaiming the former glory of Fulkreykk, or the tech barons to gain fatter profits?" } - p { - style = "text-align:center" - +"Choose the fate of your homeland with the Isarnareyksk Styurnamariyn!" - } }, ), VESTIGIUM( @@ -83,18 +66,13 @@ enum class Faction( navyName = "Imperial States Space Force", polityName = "Imperial States of America", demonymSingular = "American", - demonymPlural = "Americans", shipPrefix = "ISFC ", // Imperial Space Force Craft blurbDesc = { p { +"The Imperial States of America was once the political hyperpower of Earth and beyond, and the ideological bulwark of the Caesarism of its time. They were strong, they were proud... they were hated. Hated to the point that entire nations fled from Earth and colonized the stars just to escape American hegemony." } p { - +"The American Imperium has been fallen for a long time to barbarian warlords, and its homeworld Earth has been turned into a museum planet by the Mechyrdian government. But the government lives on; hidden away in secret space stations, they desire nothing less than to conquer the stars and establish a ten-thousand-year empire." - } - p { - style = "text-align:center" - +"Seize the stars with the Imperial States Space Force!" + +"The American Empire has been fallen for a long time to barbarian warlords, and its homeworld Earth has been turned into a museum planet by the Mechyrdian government. But the government lives on; hidden away in secret space stations, they desire nothing less than to conquer the stars and establish a ten-thousand-year empire." } }, ); diff --git a/src/jsMain/kotlin/starshipfights/game/ship_factions_js.kt b/src/jsMain/kotlin/starshipfights/game/ship_factions_js.kt deleted file mode 100644 index 0e84c13..0000000 --- a/src/jsMain/kotlin/starshipfights/game/ship_factions_js.kt +++ /dev/null @@ -1,13 +0,0 @@ -package starshipfights.game - -import kotlinx.html.TagConsumer -import kotlinx.html.p -import kotlinx.html.style - -fun Faction?.writeBlurb(tagConsumer: TagConsumer<*>) = if (this == null) - tagConsumer.p { - style = "text-align:center" - +"Select a faction by clicking one of the flags above" - } -else - tagConsumer.blurbDesc() diff --git a/src/jvmMain/kotlin/starshipfights/info/views_ships.kt b/src/jvmMain/kotlin/starshipfights/info/views_ships.kt index 8a0e168..6d36955 100644 --- a/src/jvmMain/kotlin/starshipfights/info/views_ships.kt +++ b/src/jvmMain/kotlin/starshipfights/info/views_ships.kt @@ -3,6 +3,7 @@ package starshipfights.info import io.ktor.application.* import kotlinx.html.* import starshipfights.game.* +import java.util.Comparator import kotlin.math.PI import kotlin.math.roundToInt @@ -42,16 +43,21 @@ suspend fun ApplicationCall.shipsPage(): HTML.() -> Unit = page("Game Manual", s +"At the last phase of a turn, ships fire weapons at each other. Again, both players take this phase simultaneously. Ships fire weapons at enemy ships, as far as they can and as much as they can. Damage from weapons is inflicted on targeted ships instantly, so players are encouraged to click fast when attacking enemy ships. Note that this does not apply to strike craft; they are deployed to ships, with percentages on the ship labels indicating the total strength of all strike wings surrounding a ship, and the damage done by bombers is calculated at the end of the phase, before the next turn begins." } } - val allShipTypes = ShipType.values().sortedBy { it.weightClass }.groupBy { it.faction } - allShipTypes.forEach { (faction, shipTypes) -> + ShipType.values().groupBy { it.faction }.toSortedMap().forEach { (faction, factionShipTypes) -> section { id = faction.toUrlSlug() h2 { +faction.shortName } - ul { - shipTypes.forEach { shipType -> - li { - a(href = "/info/${shipType.toUrlSlug()}") { +shipType.fullDisplayName } + + faction.blurbDesc(consumer) + + factionShipTypes.groupBy { it.weightClass }.toSortedMap(Comparator.comparingInt(ShipWeightClass::rank)).forEach { (weightClass, weightedShipTypes) -> + h3 { +weightClass.displayName } + ul { + weightedShipTypes.forEach { shipType -> + li { + a(href = "/info/${shipType.toUrlSlug()}") { +shipType.fullDisplayName } + } } } }