﻿GGGG_mo_foraged_rations = {
    texture = "gfx/interface/icons/production_method_icons/GGGG_foraging.dds"
    group   = GGGG_mog_rations
    
    possible = {
        # AI keeps using this when they really shouldn't, and I can't seem to get anything working with the ai_weight
        is_ai = no

    }
    
    upkeep_modifier = {
        goods_input_grain_add = -0.6
        goods_input_meat_add  = -0.4
    }
    
    unit_modifier = {
        unit_devastation_mult     = 0.10
        unit_morale_loss_mult     = 0.25
        unit_recovery_rate_add    = -0.25
        unit_morale_recovery_mult = -0.25
        unit_occupation_mult      = -0.50
    }
    
    ai_weight = {
        value = 0
    }
}

GGGG_mo_bread_meat_rations = {
    texture = "gfx/interface/icons/production_method_icons/GGGG_bread_meat.dds"
    group   = GGGG_mog_rations
    
    possible = {
        always = yes
    }
    
    can_be_turned_off = {
        always = no
    }
    
    upkeep_modifier = {
        goods_input_grain_add = 0.6
        goods_input_meat_add  = 0.4
    }
    
    unit_modifier = {
        dummy_modifier_type = 0
    }
    
    ai_weight = {
        value = 1
    }
}

GGGG_mo_canned_rations = {
    texture = "gfx/interface/icons/production_method_icons/GGGG_canned_goods.dds"
    group   = GGGG_mog_rations
    
    possible = {
        scope:military_formation = {
            NOT = {
                has_mobilization_option = mobilization_option:GGGG_mo_foraged_rations
            }
        }
        market ?= {
            mg:groceries ?= {
                has_potential_supply = yes
            }
        }
    }
    
    can_be_turned_off = {
        scope:military_formation = {
            NOR = {
                has_mobilization_option = mobilization_option:GGGG_mo_refrigerated_rations
            }
        }
    }
    
    on_activate_while_mobilized = {
        if = { # Allow free changes during first week of game so AI can pick for themselves what they want
            limit = { # b/c otherwise we have to overwrite vanilla military formation histories
                game_date >= 1836.1.8
            }
            custom_tooltip = {
                text = mobilization_option_it_hurts_organization_to_add_medic_support_tt
                add_organization = {
                    value = organization
                    multiply = -0.25
                }
            }
        }
    }
    
    on_deactivate_while_mobilized = {
        custom_tooltip = {
            text = mobilization_option_it_hurts_morale_and_organization_when_you_remove_medic_support_tt
            every_combat_unit = {
                add_morale = {
                    value = morale
                    multiply = -0.5
                }
            }
            add_organization = {
                value = organization
                multiply = -0.25
            }
        }
    }
    
    unlocking_technologies = {
        canneries
    }
    
    upkeep_modifier = {
        goods_input_groceries_add = 1
        goods_input_grain_add     = -0.6
        goods_input_meat_add      = -0.4
    }
    
    unit_modifier = {
        dummy_modifier_type = 0
    }
    
    ai_weight = {
        value = 100
    }
}

GGGG_mo_refrigerated_rations = {
    texture = "gfx/interface/icons/production_method_icons/GGGG_refrigerated.dds"
    group   = GGGG_mog_rations
    
    possible = {
        scope:military_formation = {
            has_mobilization_option = mobilization_option:GGGG_mo_canned_rations
        }
        market ?= {
            mg:fruit ?= {
                has_potential_supply = yes
            }
            mg:meat ?= {
                has_potential_supply = yes
            }
            mg:electricity ?= {
                has_potential_supply = yes
            }
        }
    }
    
    on_activate_while_mobilized = {
        if = {
            limit = {
                game_date >= 1836.1.8
            }
            custom_tooltip = {
                text = mobilization_option_it_hurts_organization_to_add_medic_support_tt
                add_organization = {
                    value = organization
                    multiply = -0.25
                }
            }
        }
    }
    
    on_deactivate_while_mobilized = {
        custom_tooltip = {
            text = mobilization_option_it_hurts_morale_and_organization_when_you_remove_medic_support_tt
            every_combat_unit = {
                add_morale = {
                    value = morale
                    multiply = -0.5
                }
            }
            add_organization = {
                value = organization
                multiply = -0.25
            }
        }
    }
    
    unlocking_technologies = {
        pasteurization
    }
    
    upkeep_modifier = {
        goods_input_fruit_add       = 0.25
        goods_input_meat_add        = 0.25
        goods_input_groceries_add   = -0.5
        goods_input_electricity_add = 0.1
    }
    
    unit_modifier = {
        unit_morale_recovery_mult = 0.10
    }
    
    ai_weight = {
        value = 20000
    }
}

mobilization_option_basic_supplies = {
	texture = "gfx/interface/icons/mobilization_options/basic_supplies.dds"
	can_be_turned_off = {
		custom_tooltip = {
		    text = mobilization_option_basic_supplies_can_be_turned_off_tt
			always = no
		}
	}
	upkeep_modifier = {
		# goods_input_grain_add = 0.5 # GGGG
	}
	upkeep_modifier_unscaled = {
        # GGGG
        goods_input_grain_mult = 0.25
        goods_input_meat_mult = 0.25
        goods_input_groceries_mult = 0.25
        goods_input_fruit_mult = 0.25
	}

	unit_modifier = {
		# empty on purpose - this is the minimum mobilization cost
	}
	ai_weight = {
		value = 1
	}

	group   = GGGG_mog_rations
}

mobilization_option_extra_supplies = {
	texture = "gfx/interface/icons/mobilization_options/extra_supplies.dds"

	possible = {
		market ?= {
			mg:groceries ?= {
				has_potential_supply = yes
			}
		}
	}

	unlocking_technologies = {
		army_reserves
	}

	on_deactivate_while_mobilized = {
		custom_tooltip = {
			text = mobilization_option_it_hurts_morale_when_you_remove_supplies_while_in_combat_tt
			every_combat_unit = {
				add_morale = {
					value = morale
					multiply = -0.25
				}
			}
		}
	}

	upkeep_modifier = {
		# goods_input_groceries_add = 1 # GGGG
        goods_input_sugar_add = 0.5
        goods_input_liquor_add = 0.5
	}
	upkeep_modifier_unscaled = {
        # GGGG
        goods_input_grain_mult = 0.25
        goods_input_meat_mult = 0.25
        goods_input_groceries_mult = 0.25
        goods_input_fruit_mult = 0.25
	}

	unit_modifier = {
		unit_morale_loss_mult = -0.05
        unit_morale_recovery_mult = 0.1
		unit_offense_mult = 0.05
		unit_defense_mult = 0.05
	}
	ai_weight = {
		value = 1
	}

	group   = GGGG_mog_rations
}

mobilization_option_luxurious_supplies = {
	texture = "gfx/interface/icons/mobilization_options/luxurious_supplies.dds"

	possible = {
		scope:military_formation = { has_mobilization_option = mobilization_option:mobilization_option_extra_supplies }
		market ?= {
			mg:meat ?= {
				has_potential_supply = yes
			}
			mg:wine ?= {
				has_potential_supply = yes
			}
		}
	}

	unlocking_technologies = {
		military_statistics
	}

	on_deactivate_while_mobilized = {
		custom_tooltip = {
			text = mobilization_option_it_hurts_morale_when_you_remove_supplies_while_in_combat_tt
			every_combat_unit = {
				add_morale = {
					value = morale
					multiply = -0.25
				}
			}
		}
	}

	upkeep_modifier = {
		# goods_input_meat_add = 1 # GGGG
		# goods_input_wine_add = 1 # GGGG (Moved to supplements)
        goods_input_wine_add = 0.5
        goods_input_tobacco_add = 0.5
	}
	upkeep_modifier_unscaled = {
        # GGGG
        goods_input_grain_mult = 0.25
        goods_input_meat_mult = 0.25
        goods_input_groceries_mult = 0.25
        goods_input_fruit_mult = 0.25
        goods_input_sugar_mult = 0.25
        goods_input_liquor_mult = 0.25
	}

	unit_modifier = {
		unit_morale_loss_mult = -0.05
        unit_morale_recovery_mult = 0.1
		unit_offense_mult = 0.05
		unit_defense_mult = 0.05
	}
	ai_weight = {
		value = 1
	}

	group   = GGGG_mog_rations
}
