openly-retro / stellaris-machine-robot-expansion

Reviving XVCV's "Machine & Robot Expansion" mod
https://steamcommunity.com/sharedfiles/filedetails/?id=3163759042
2 stars 2 forks source link

Implement xvcv_mdlc_leader_making_trait_pick_alt_effect to add dlc restrictions to trait #71

Closed openly-retro closed 6 months ago

openly-retro commented 6 months ago

I implemented this wrong.. go back thru the traits, decide which should have DLC restrictions (maybe make a separate map of trait names to DLC) and then knocktogether some lines of code to properly print this out to restrict players from picking (not seeing, but picking) a trait if they dont have the required DLC.

#leader_trait_trickster_2
xvcv_mdlc_leader_making_trait_admiral_leader_trait_trickster_2_add_button_effect = {
    potential = { always = yes }
    allow = {
        xvcv_mdlc_leader_making_trait_pick_alt_trigger = { CLASS = admiral ID = leader_trait_trickster_2 SCRIPTED_TRIGGER = has_first_contact_dlc BOOLEAN = yes }
        xvcv_mdlc_leader_making_trait_cost_trigger = yes
        xvcv_mdlc_leader_making_trait_points_trigger = yes
        xvcv_mdlc_leader_making_trait_max_number_trigger = yes
        xvcv_mdlc_leader_making_picked_class_admiral_trigger = yes
    }
    effect = {
        xvcv_mdlc_leader_making_trait_pick_alt_effect = { CLASS = admiral ID = leader_trait_trickster_2 SCRIPTED_TRIGGER = has_first_contact_dlc BOOLEAN = yes }
        hidden_effect = { xvcv_mdlc_leader_making_trait_count_points_costs_effect = yes }
    }
}
openly-retro commented 6 months ago

Not needed as I have got code going to directly add "has_whatever_dlc" to the button effects. Done in https://github.com/openly-retro/stellaris-machine-robot-expansion/pull/96