mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-30 15:30:43 -04:00
Added unique civ text for attacking, being attacked, and being defeated
This commit is contained in:
parent
07663bfc54
commit
796284c7e2
@ -2,6 +2,9 @@
|
|||||||
{
|
{
|
||||||
name:"Babylon",
|
name:"Babylon",
|
||||||
leaderName:"Nebuchadnezzar II",
|
leaderName:"Nebuchadnezzar II",
|
||||||
|
declaringWar:"The demon wants the blood of soldiers!"
|
||||||
|
attacked:"Oh well, I presume you know what you're doing."
|
||||||
|
defeated:"It is over. Perhaps now I shall have peace, at last."
|
||||||
mainColor:[27,53,63],
|
mainColor:[27,53,63],
|
||||||
secondaryColor:[213,249,255],
|
secondaryColor:[213,249,255],
|
||||||
unique:"Receive free Great Scientist when you discover Writing, Earn Great Scientists 50% faster",
|
unique:"Receive free Great Scientist when you discover Writing, Earn Great Scientists 50% faster",
|
||||||
@ -11,6 +14,9 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name:"Greece",
|
name:"Greece",
|
||||||
|
declaringWar:"You are in my way, you must be destroyed."
|
||||||
|
attacked:"As a matter of fact I too grow weary of peace."
|
||||||
|
defeated:"You have somehow become my undoing! What kind of beast are you?"
|
||||||
leaderName:"Alexander",
|
leaderName:"Alexander",
|
||||||
mainColor:[181, 232, 232],
|
mainColor:[181, 232, 232],
|
||||||
secondaryColor:[68,142,249],
|
secondaryColor:[68,142,249],
|
||||||
@ -21,6 +27,9 @@
|
|||||||
{
|
{
|
||||||
name:"China",
|
name:"China",
|
||||||
leaderName:"Wu Zetian",
|
leaderName:"Wu Zetian",
|
||||||
|
declaringWar:"You won't ever be able to bother me again. Go meet Yama."
|
||||||
|
attacked:"Fool! I will disembowel you all!"
|
||||||
|
defeated:"You have proven to be a cunning and competent adversary. I congratulate you on your victory."
|
||||||
mainColor:[9, 112, 84],
|
mainColor:[9, 112, 84],
|
||||||
secondaryColor:[255,255,255],
|
secondaryColor:[255,255,255],
|
||||||
unique:"Great general provides double combat bonus, and spawns 50% faster"
|
unique:"Great general provides double combat bonus, and spawns 50% faster"
|
||||||
@ -31,6 +40,9 @@
|
|||||||
{
|
{
|
||||||
name:"Egypt",
|
name:"Egypt",
|
||||||
leaderName:"Ramesses II",
|
leaderName:"Ramesses II",
|
||||||
|
declaringWar:"You are but a pest on this Earth, prepare to be eliminated!",
|
||||||
|
attacked:"You are a fool who evokes pity. You have brought my hostility upon yourself and your repulsive civilization!"
|
||||||
|
defeated:"Strike me down and my soul will torment yours forever – you have won nothing."
|
||||||
mainColor:[ 231, 213, 0],
|
mainColor:[ 231, 213, 0],
|
||||||
secondaryColor:[98,10,210],
|
secondaryColor:[98,10,210],
|
||||||
unique:"+20% production towards Wonder construction"
|
unique:"+20% production towards Wonder construction"
|
||||||
@ -41,6 +53,9 @@
|
|||||||
{
|
{
|
||||||
name:"England",
|
name:"England",
|
||||||
leaderName:"Elizabeth",
|
leaderName:"Elizabeth",
|
||||||
|
declaringWar:"By the grace of God, your days are numbered."
|
||||||
|
attacked:"We shall never surrender."
|
||||||
|
defeated:"You have triumphed over us. The day is yours."
|
||||||
mainColor:[ 114, 0, 0],
|
mainColor:[ 114, 0, 0],
|
||||||
secondaryColor:[255,255,255],
|
secondaryColor:[255,255,255],
|
||||||
unique:"+2 movement for all naval units"
|
unique:"+2 movement for all naval units"
|
||||||
@ -51,6 +66,9 @@
|
|||||||
{
|
{
|
||||||
name:"France",
|
name:"France",
|
||||||
leaderName:"Napoleon",
|
leaderName:"Napoleon",
|
||||||
|
declaringWar:"You're disturbing us, prepare for war.",
|
||||||
|
attacked:"You've fallen into my trap. I'll bury you.",
|
||||||
|
defeated:"I congratulate you for your victory."
|
||||||
mainColor:[ 38, 98, 255],
|
mainColor:[ 38, 98, 255],
|
||||||
secondaryColor:[239,236,148],
|
secondaryColor:[239,236,148],
|
||||||
unique:"+2 Culture per turn from cities before discovering Steam Power",
|
unique:"+2 Culture per turn from cities before discovering Steam Power",
|
||||||
@ -61,6 +79,9 @@
|
|||||||
{
|
{
|
||||||
name:"Russia",
|
name:"Russia",
|
||||||
leaderName:"Catherine",
|
leaderName:"Catherine",
|
||||||
|
declaringWar:"You've behaved yourself very badly, you know it. Now it's payback time.",
|
||||||
|
attacked:"You've mistaken my passion for a weakness, you'll regret about this."
|
||||||
|
defeated:"We were defeated, so this makes me your prisoner. I suppose there are worse fates."
|
||||||
mainColor:[ 236, 178, 0],
|
mainColor:[ 236, 178, 0],
|
||||||
secondaryColor:[0,0,0],
|
secondaryColor:[0,0,0],
|
||||||
unique:"Strategic Resources provide +1 Production, and Horses, Iron and Uranium Resources provide double quantity",
|
unique:"Strategic Resources provide +1 Production, and Horses, Iron and Uranium Resources provide double quantity",
|
||||||
@ -71,6 +92,9 @@
|
|||||||
{
|
{
|
||||||
name:"Rome",
|
name:"Rome",
|
||||||
leaderName:"Augustus Caesar",
|
leaderName:"Augustus Caesar",
|
||||||
|
declaringWar:"My treasury contains little and my soldiers are getting impatient... <sigh> ...therefore you must die."
|
||||||
|
attacked:"So brave, yet so stupid! If only you had a brain similar to your courage."
|
||||||
|
defeated:"The gods have deprived Rome of their favour. We have been defeated."
|
||||||
mainColor:[ 53,0,87],
|
mainColor:[ 53,0,87],
|
||||||
secondaryColor:[238,201,9],
|
secondaryColor:[238,201,9],
|
||||||
unique:"+25% Production towards any buildings that already exist in the Capital",
|
unique:"+25% Production towards any buildings that already exist in the Capital",
|
||||||
@ -81,6 +105,9 @@
|
|||||||
{
|
{
|
||||||
name:"Arabia",
|
name:"Arabia",
|
||||||
leaderName:"Harun al-Rashid",
|
leaderName:"Harun al-Rashid",
|
||||||
|
declaringWar:"The world will be more beautiful without you. Prepare for war."
|
||||||
|
attacked:"Fool! You will soon regret dearly! I swear it!"
|
||||||
|
defeated:"You have won, congratulations. My palace is now in your possession, and I beg that you care well for the peacock."
|
||||||
mainColor:[ 41,83,42],
|
mainColor:[ 41,83,42],
|
||||||
secondaryColor:[146,221,9],
|
secondaryColor:[146,221,9],
|
||||||
cities:["Mecca","Medina","Damascus","Baghdad","Najran","Kufah","Basra","Khurasan","Anjar","Fustat",
|
cities:["Mecca","Medina","Damascus","Baghdad","Najran","Kufah","Basra","Khurasan","Anjar","Fustat",
|
||||||
@ -90,6 +117,9 @@
|
|||||||
{
|
{
|
||||||
name:"America",
|
name:"America",
|
||||||
leaderName:"Washington",
|
leaderName:"Washington",
|
||||||
|
declaringWar:"Your wanton aggression leaves us no choice. Prepare for war!"
|
||||||
|
attacked:"You have mistaken our love of peace for weakness. You shall regret this!"
|
||||||
|
defeated:"The day...is yours. I hope you will be merciful in your triumph."
|
||||||
mainColor:[ 28,51,119],
|
mainColor:[ 28,51,119],
|
||||||
secondaryColor:[255,255,255],
|
secondaryColor:[255,255,255],
|
||||||
unique:"All land military units have +1 sight, 50% discount when purchasing tiles",
|
unique:"All land military units have +1 sight, 50% discount when purchasing tiles",
|
||||||
|
@ -4019,6 +4019,8 @@
|
|||||||
German:"Schwierigkeitsgrad"
|
German:"Schwierigkeitsgrad"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Diplomacy!
|
||||||
|
|
||||||
"Diplomacy":{
|
"Diplomacy":{
|
||||||
Italian:"Diplomazia"
|
Italian:"Diplomazia"
|
||||||
Russian:"Дипломатия"
|
Russian:"Дипломатия"
|
||||||
@ -4074,6 +4076,10 @@
|
|||||||
German:"[civName] hat uns den Krieg erklärt!"
|
German:"[civName] hat uns den Krieg erklärt!"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
"You'll pay for this!":{}
|
||||||
|
"Very well.":{}
|
||||||
|
"Farewell.":{}
|
||||||
|
|
||||||
// Overview screen
|
// Overview screen
|
||||||
"Overview":{
|
"Overview":{
|
||||||
Italian:"Panoramica"
|
Italian:"Panoramica"
|
||||||
@ -4275,6 +4281,8 @@
|
|||||||
German:"Nächstgelegene Stadt"
|
German:"Nächstgelegene Stadt"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
"Defeated":{}
|
||||||
|
|
||||||
|
|
||||||
// Buildings!
|
// Buildings!
|
||||||
"Palace":{
|
"Palace":{
|
||||||
@ -7363,4 +7371,5 @@
|
|||||||
French:"Détruiser [civName]"
|
French:"Détruiser [civName]"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,7 @@ class NextTurnAutomation{
|
|||||||
automateUnits(civInfo)
|
automateUnits(civInfo)
|
||||||
reassignWorkedTiles(civInfo)
|
reassignWorkedTiles(civInfo)
|
||||||
trainSettler(civInfo)
|
trainSettler(civInfo)
|
||||||
|
civInfo.diplomaticIncidents.clear()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun buyBuildingOrUnit(civInfo: CivilizationInfo) {
|
private fun buyBuildingOrUnit(civInfo: CivilizationInfo) {
|
||||||
|
@ -3,6 +3,8 @@ package com.unciv.logic.battle
|
|||||||
import com.badlogic.gdx.graphics.Color
|
import com.badlogic.gdx.graphics.Color
|
||||||
import com.unciv.logic.GameInfo
|
import com.unciv.logic.GameInfo
|
||||||
import com.unciv.logic.city.CityInfo
|
import com.unciv.logic.city.CityInfo
|
||||||
|
import com.unciv.logic.civilization.diplomacy.DiplomaticIncident
|
||||||
|
import com.unciv.logic.civilization.diplomacy.DiplomaticIncidentType
|
||||||
import com.unciv.logic.map.TileInfo
|
import com.unciv.logic.map.TileInfo
|
||||||
import com.unciv.models.gamebasics.unit.UnitType
|
import com.unciv.models.gamebasics.unit.UnitType
|
||||||
import java.util.*
|
import java.util.*
|
||||||
@ -163,6 +165,7 @@ class Battle(val gameInfo:GameInfo) {
|
|||||||
for(civ in gameInfo.civilizations)
|
for(civ in gameInfo.civilizations)
|
||||||
civ.addNotification("The civilization of [${enemyCiv.civName}] has been destroyed!", null, Color.RED)
|
civ.addNotification("The civilization of [${enemyCiv.civName}] has been destroyed!", null, Color.RED)
|
||||||
enemyCiv.getCivUnits().forEach { it.destroy() }
|
enemyCiv.getCivUnits().forEach { it.destroy() }
|
||||||
|
attacker.getCivInfo().diplomaticIncidents.add(DiplomaticIncident(enemyCiv.civName,DiplomaticIncidentType.Defeated))
|
||||||
}
|
}
|
||||||
else if(enemyCiv.cities.isNotEmpty()){
|
else if(enemyCiv.cities.isNotEmpty()){
|
||||||
enemyCiv.cities.first().cityConstructions.addBuilding("Palace") // relocate palace
|
enemyCiv.cities.first().cityConstructions.addBuilding("Palace") // relocate palace
|
||||||
|
@ -2,5 +2,5 @@ package com.unciv.logic.civilization.diplomacy
|
|||||||
|
|
||||||
enum class DiplomaticIncidentType{
|
enum class DiplomaticIncidentType{
|
||||||
WarDeclaration,
|
WarDeclaration,
|
||||||
TradeOffer
|
Defeated
|
||||||
}
|
}
|
@ -7,6 +7,11 @@ import com.unciv.ui.utils.colorFromRGB
|
|||||||
class Nation : INamed {
|
class Nation : INamed {
|
||||||
override lateinit var name: String
|
override lateinit var name: String
|
||||||
lateinit var leaderName: String
|
lateinit var leaderName: String
|
||||||
|
|
||||||
|
lateinit var declaringWar:String
|
||||||
|
lateinit var attacked:String
|
||||||
|
lateinit var defeated:String
|
||||||
|
|
||||||
lateinit var mainColor: List<Int>
|
lateinit var mainColor: List<Int>
|
||||||
var unique:String?=null
|
var unique:String?=null
|
||||||
var secondaryColor: List<Int>?=null
|
var secondaryColor: List<Int>?=null
|
||||||
|
@ -296,10 +296,14 @@ class EmpireOverviewScreen : CameraStageBaseScreen(){
|
|||||||
val civGroup = Table()
|
val civGroup = Table()
|
||||||
val civGroupBackground = ImageGetter.getDrawable("OtherIcons/civTableBackground.png")
|
val civGroupBackground = ImageGetter.getDrawable("OtherIcons/civTableBackground.png")
|
||||||
|
|
||||||
val label = Label(civ.civName.tr(), CameraStageBaseScreen.skin)
|
var civNameText = civ.civName.tr()
|
||||||
|
if(civ.isDefeated()) civNameText += "\n({Defeated})".tr()
|
||||||
|
val label = Label(civNameText, CameraStageBaseScreen.skin)
|
||||||
|
label.setAlignment(Align.center)
|
||||||
|
|
||||||
if (civ.isDefeated()) {
|
if (civ.isDefeated()) {
|
||||||
civGroup.background = civGroupBackground.tint(Color.LIGHT_GRAY)
|
civGroup.background = civGroupBackground.tint(Color.LIGHT_GRAY)
|
||||||
|
label.setFontColor(Color.BLACK)
|
||||||
} else if (playerKnows(civ)) {
|
} else if (playerKnows(civ)) {
|
||||||
civGroup.background = civGroupBackground.tint(civ.getNation().getColor())
|
civGroup.background = civGroupBackground.tint(civ.getNation().getColor())
|
||||||
label.setFontColor(civ.getNation().getSecondaryColor())
|
label.setFontColor(civ.getNation().getSecondaryColor())
|
||||||
|
@ -5,6 +5,7 @@ import com.badlogic.gdx.scenes.scene2d.ui.*
|
|||||||
import com.unciv.UnCivGame
|
import com.unciv.UnCivGame
|
||||||
import com.unciv.models.gamebasics.tr
|
import com.unciv.models.gamebasics.tr
|
||||||
import com.unciv.ui.utils.*
|
import com.unciv.ui.utils.*
|
||||||
|
import com.unciv.ui.worldscreen.optionstable.PopupTable
|
||||||
import com.unciv.ui.worldscreen.optionstable.YesNoPopupTable
|
import com.unciv.ui.worldscreen.optionstable.YesNoPopupTable
|
||||||
|
|
||||||
class DiplomacyScreen:CameraStageBaseScreen(){
|
class DiplomacyScreen:CameraStageBaseScreen(){
|
||||||
@ -64,7 +65,17 @@ class DiplomacyScreen:CameraStageBaseScreen(){
|
|||||||
declareWarButton.onClick {
|
declareWarButton.onClick {
|
||||||
YesNoPopupTable("Declare war on [${civ.civName}]?".tr(), {
|
YesNoPopupTable("Declare war on [${civ.civName}]?".tr(), {
|
||||||
civDiplomacy.declareWar()
|
civDiplomacy.declareWar()
|
||||||
updateLeftSideTable()}, this@DiplomacyScreen)
|
|
||||||
|
val responsePopup = PopupTable(this)
|
||||||
|
val otherCivLeaderName = civ.getNation().leaderName + " of " + civ.civName
|
||||||
|
responsePopup.add(Label(otherCivLeaderName, skin))
|
||||||
|
responsePopup.addSeparator()
|
||||||
|
responsePopup.addGoodSizedLabel(civ.getNation().attacked).row()
|
||||||
|
responsePopup.addButton("Very well.".tr()) { responsePopup.remove() }
|
||||||
|
responsePopup.open()
|
||||||
|
|
||||||
|
updateLeftSideTable()
|
||||||
|
}, this)
|
||||||
}
|
}
|
||||||
civTable.add(declareWarButton).row()
|
civTable.add(declareWarButton).row()
|
||||||
}
|
}
|
||||||
|
@ -311,27 +311,30 @@ class WorldScreen : CameraStageBaseScreen() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class DiplomaticIncidentPopup(val worldScreen: WorldScreen, val diplomaticIncident: DiplomaticIncident):PopupTable(worldScreen){
|
class DiplomaticIncidentPopup(val worldScreen: WorldScreen, val diplomaticIncident: DiplomaticIncident):PopupTable(worldScreen){
|
||||||
|
fun getCloseButton(text:String): TextButton {
|
||||||
|
val button = TextButton(text.tr(), skin)
|
||||||
|
button.onClick { close() }
|
||||||
|
return button
|
||||||
|
}
|
||||||
|
|
||||||
init {
|
init {
|
||||||
val otherCiv = worldScreen.gameInfo.getCivilization(diplomaticIncident.civName)
|
val otherCiv = worldScreen.gameInfo.getCivilization(diplomaticIncident.civName)
|
||||||
val otherCivLeaderName = otherCiv.getNation().leaderName+" of "+otherCiv.civName
|
val otherCivLeaderName = otherCiv.getNation().leaderName+" of "+otherCiv.civName
|
||||||
add(Label(otherCivLeaderName,skin))
|
add(Label(otherCivLeaderName,skin))
|
||||||
addSeparator()
|
addSeparator()
|
||||||
|
|
||||||
when(diplomaticIncident.type){
|
when(diplomaticIncident.type){
|
||||||
DiplomaticIncidentType.WarDeclaration -> {
|
DiplomaticIncidentType.WarDeclaration -> {
|
||||||
add(Label("We've decided to declare war on you, k?",skin)).row()
|
addGoodSizedLabel(otherCiv.getNation().declaringWar).row()
|
||||||
val responseTable = Table()
|
val responseTable = Table()
|
||||||
|
responseTable.add(getCloseButton("You'll pay for this!"))
|
||||||
val angryResponse = TextButton("You'll pay for this",skin)
|
responseTable.add(getCloseButton("Very well."))
|
||||||
angryResponse.onClick { close() }
|
|
||||||
|
|
||||||
val acceptingResponse= TextButton("This is fine",skin)
|
|
||||||
acceptingResponse.onClick { close() }
|
|
||||||
|
|
||||||
responseTable.add(angryResponse)
|
|
||||||
responseTable.add(acceptingResponse)
|
|
||||||
add(responseTable)
|
add(responseTable)
|
||||||
}
|
}
|
||||||
DiplomaticIncidentType.TradeOffer -> TODO()
|
DiplomaticIncidentType.Defeated -> {
|
||||||
|
addGoodSizedLabel(otherCiv.getNation().defeated).row()
|
||||||
|
add(getCloseButton("Farewell."))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
open()
|
open()
|
||||||
isOpen = true
|
isOpen = true
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.unciv.ui.worldscreen.optionstable
|
package com.unciv.ui.worldscreen.optionstable
|
||||||
|
|
||||||
import com.badlogic.gdx.graphics.Color
|
import com.badlogic.gdx.graphics.Color
|
||||||
|
import com.badlogic.gdx.scenes.scene2d.ui.Cell
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.Label
|
import com.badlogic.gdx.scenes.scene2d.ui.Label
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.Table
|
import com.badlogic.gdx.scenes.scene2d.ui.Table
|
||||||
import com.badlogic.gdx.scenes.scene2d.ui.TextButton
|
import com.badlogic.gdx.scenes.scene2d.ui.TextButton
|
||||||
@ -26,6 +27,12 @@ open class PopupTable(val screen: CameraStageBaseScreen): Table(CameraStageBaseS
|
|||||||
screen.stage.addActor(this)
|
screen.stage.addActor(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun addGoodSizedLabel(text: String): Cell<Label> {
|
||||||
|
val label = Label(text,CameraStageBaseScreen.skin)
|
||||||
|
label.setWrap(true)
|
||||||
|
return add(label).width(screen.stage.width/2)
|
||||||
|
}
|
||||||
|
|
||||||
fun addButton(text:String, action:()->Unit){
|
fun addButton(text:String, action:()->Unit){
|
||||||
val button = TextButton(text.tr(), skin).apply { color= ImageGetter.getBlue() }
|
val button = TextButton(text.tr(), skin).apply { color= ImageGetter.getBlue() }
|
||||||
button.onClick(action)
|
button.onClick(action)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user