Skip to content

Commit 657b4d7

Browse files
[Xedra Evolved] The holy light of the sun burns vampires' impure flesh (#82941)
1 parent 1f6023d commit 657b4d7

File tree

9 files changed

+76
-70
lines changed

9 files changed

+76
-70
lines changed

data/json/flags.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2359,6 +2359,16 @@
23592359
"type": "json_flag",
23602360
"info": "This tool can test for voltage."
23612361
},
2362+
{
2363+
"id": "SUNBURN_SUPERNATURAL",
2364+
"type": "json_flag",
2365+
"info": "You burn in the sunlight like a vampire. Probably because you're a vampire."
2366+
},
2367+
{
2368+
"id": "SUNBURN_SUPERNATURAL_REDUCTION",
2369+
"type": "json_flag",
2370+
"info": "You burn in the sunlight like a vampire, but not quite as badly."
2371+
},
23622372
{
23632373
"id": "SHREDDED",
23642374
"type": "json_flag",

data/mods/Xedra_Evolved/effects/effects.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3656,6 +3656,14 @@
36563656
"show_in_info": false,
36573657
"flags": [ "SUPPRESS_INVISIBILITY" ]
36583658
},
3659+
{
3660+
"type": "effect_type",
3661+
"id": "effect_vampire_burn_to_death_in_sunlight",
3662+
"//": "Hidden effect, carries the flags so that vampires who blot out the sun with their powers don't burn in sunlight.",
3663+
"name": [ "" ],
3664+
"desc": [ "" ],
3665+
"flags": [ "SUNBURN", "SUNBURN_SUPERNATURAL" ]
3666+
},
36593667
{
36603668
"type": "effect_type",
36613669
"//": "Checks if you have every single vampiric power when trying to learn new ones.",

data/mods/Xedra_Evolved/eocs/eoc_conditions.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,11 @@
6565
]
6666
},
6767
"effect": [ ]
68+
},
69+
{
70+
"type": "effect_on_condition",
71+
"id": "EOC_CONDITION_XE_VAMPIRE_AVOID_BURNING_IN_SUNLIGHT",
72+
"condition": { "and": [ { "not": { "is_weather": "blotted_sun" } } ] },
73+
"effect": [ ]
6874
}
6975
]
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[
2+
{
3+
"type": "effect_on_condition",
4+
"id": "EOC_CONDITION_XE_VAMPIRE_AVOID_BURNING_IN_SUNLIGHT",
5+
"condition": { "and": [ { "not": { "is_weather": "blotted_sun" } }, { "not": { "u_has_trait": "mut_skyisland_sunblock_real" } } ] },
6+
"effect": [ ]
7+
}
8+
]

data/mods/Xedra_Evolved/mutations/mutations.json

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,8 @@
700700
{ "type": "bullet", "multiply": -0.08 }
701701
]
702702
}
703-
]
703+
],
704+
"active_flags": [ "SUNBURN_SUPERNATURAL_REDUCTION" ]
704705
},
705706
{
706707
"type": "mutation",
@@ -1037,13 +1038,13 @@
10371038
"id": "VAMPIRE3",
10381039
"name": { "str": "Mortal hungers are replaced with immortal hungers" },
10391040
"points": 0,
1040-
"description": "You replace some of your regular caloric intake with blood and begin to see some of the more esoteric abilities inherent to vampirism.",
1041+
"description": "You replace some of your regular caloric intake with blood and begin to see some of the more esoteric abilities inherent to vampirism, though the sun now burns exposed flesh.",
10411042
"starting_trait": false,
10421043
"purifiable": false,
10431044
"valid": false,
10441045
"vitamins_absorb_multi": [ [ "all", [ [ "human_blood_vitamin", 1.25 ] ] ] ],
10451046
"vitamin_rates": [ [ "human_blood_vitamin", 720 ], [ "mutagen", 300 ] ],
1046-
"flags": [ "CANNIBAL", "ALBINO", "DAYFEAR", "HEMOVORE" ],
1047+
"flags": [ "CANNIBAL", "SUNBURN", "ALBINO", "DAYFEAR", "HEMOVORE" ],
10471048
"enchantments": [
10481049
{ "condition": { "not": "is_day" }, "values": [ { "value": "OVERMAP_SIGHT", "add": 1 } ] },
10491050
{ "values": [ { "value": "STAMINA_REGEN_MOD", "add": 0.2 }, { "value": "METABOLISM", "multiply": -0.2 } ] }
@@ -1172,7 +1173,7 @@
11721173
"starting_trait": false,
11731174
"purifiable": false,
11741175
"valid": false,
1175-
"flags": [ "CANNIBAL", "SUNBURN", "DAYFEAR", "HEMOVORE", "MEND_ALL" ],
1176+
"flags": [ "CANNIBAL", "DAYFEAR", "HEMOVORE", "MEND_ALL" ],
11761177
"enchantments": [
11771178
{
11781179
"values": [
@@ -1223,6 +1224,10 @@
12231224
{ "effect": "effect_vampire_immune_to_classic_zombification", "intensity": 1 },
12241225
{ "effect": "effect_dhampir_corpselike_pallor_pale", "intensity": 1 }
12251226
]
1227+
},
1228+
{
1229+
"condition": { "test_eoc": "EOC_CONDITION_XE_VAMPIRE_AVOID_BURNING_IN_SUNLIGHT" },
1230+
"ench_effects": [ { "effect": "effect_vampire_burn_to_death_in_sunlight", "intensity": 1 } ]
12261231
}
12271232
]
12281233
},
@@ -1430,7 +1435,7 @@
14301435
"purifiable": false,
14311436
"valid": false,
14321437
"can_only_eat": [ "blood", "hblood", "fae_blood", "vampire_blood" ],
1433-
"flags": [ "CANNIBAL", "SUNBURN", "DAYFEAR", "NO_THIRST" ],
1438+
"flags": [ "CANNIBAL", "DAYFEAR", "NO_THIRST" ],
14341439
"vitamin_rates": [ [ "vitC", -500 ], [ "iron", -500 ], [ "calcium", -500 ] ],
14351440
"//": "When weariness can be modified through Json, this mutation should make the player immune to it.",
14361441
"enchantments": [
@@ -1443,6 +1448,10 @@
14431448
{ "value": "THIRST", "multiply": -1 },
14441449
{ "value": "METABOLISM", "multiply": -1 }
14451450
]
1451+
},
1452+
{
1453+
"condition": { "test_eoc": "EOC_CONDITION_XE_VAMPIRE_AVOID_BURNING_IN_SUNLIGHT" },
1454+
"ench_effects": [ { "effect": "effect_vampire_burn_to_death_in_sunlight", "intensity": 1 } ]
14461455
}
14471456
]
14481457
},

data/mods/Xedra_Evolved/mutations/vampire_trait_eocs.json

Lines changed: 1 addition & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@
636636
"eoc_type": "EVENT",
637637
"required_event": "gains_mutation",
638638
"condition": { "compare_string": [ "ANATHEMA_WEAKNESS_SUN_BURN", { "context_val": "trait" } ] },
639-
"effect": [ { "u_message": "You know with certainty that standing under the sun is now a lethal threat.", "type": "bad" } ]
639+
"effect": [ { "u_message": "You know with certainty that standing under the sun will slay you in moments.", "type": "bad" } ]
640640
},
641641
{
642642
"type": "effect_on_condition",
@@ -2669,62 +2669,6 @@
26692669
}
26702670
]
26712671
},
2672-
{
2673-
"type": "effect_on_condition",
2674-
"id": "EOC_SUN_BURN_CHECK",
2675-
"//": "Until the day a single effect can damage all bodyparts at once, Slain by the Sun will need this EOC to work.",
2676-
"recurrence": 1,
2677-
"condition": {
2678-
"and": [
2679-
{ "u_has_trait": "ANATHEMA_WEAKNESS_SUN_BURN" },
2680-
"is_day",
2681-
"u_is_outside",
2682-
{ "not": { "is_weather": "blotted_sun" } },
2683-
{ "not": { "u_has_effect": "effect_sun_burn_grace_period" } }
2684-
]
2685-
},
2686-
"deactivate_condition": { "not": { "u_has_trait": "ANATHEMA_WEAKNESS_SUN_BURN" } },
2687-
"effect": [
2688-
{ "u_add_effect": "effect_slain_by_the_sun", "duration": 100, "target_part": "arm_l" },
2689-
{ "u_add_effect": "effect_slain_by_the_sun", "duration": 100, "target_part": "arm_r" },
2690-
{ "u_add_effect": "effect_slain_by_the_sun", "duration": 100, "target_part": "leg_l" },
2691-
{ "u_add_effect": "effect_slain_by_the_sun", "duration": 100, "target_part": "leg_r" },
2692-
{ "u_add_effect": "effect_slain_by_the_sun", "duration": 100, "target_part": "torso" },
2693-
{ "u_add_effect": "effect_slain_by_the_sun", "duration": 100, "target_part": "head" },
2694-
{ "u_message": "You are under the sun! You must find shelter from its rays or you will die!", "type": "bad" }
2695-
],
2696-
"false_effect": [
2697-
{
2698-
"run_eocs": [
2699-
{
2700-
"id": "EOC_SUN_BURN_CHECK_REMOVE",
2701-
"condition": {
2702-
"or": [
2703-
{ "math": [ "u_effect_intensity('effect_slain_by_the_sun', 'bodypart': 'arm_l') >= 1" ] },
2704-
{ "math": [ "u_effect_intensity('effect_slain_by_the_sun', 'bodypart': 'arm_r') >= 1" ] },
2705-
{ "math": [ "u_effect_intensity('effect_slain_by_the_sun', 'bodypart': 'leg_l') >= 1" ] },
2706-
{ "math": [ "u_effect_intensity('effect_slain_by_the_sun', 'bodypart': 'leg_r') >= 1" ] },
2707-
{ "math": [ "u_effect_intensity('effect_slain_by_the_sun', 'bodypart': 'torso') >= 1" ] },
2708-
{ "math": [ "u_effect_intensity('effect_slain_by_the_sun', 'bodypart': 'head') >= 1" ] }
2709-
]
2710-
},
2711-
"effect": [
2712-
{ "u_lose_effect": "effect_slain_by_the_sun", "target_part": "arm_l" },
2713-
{ "u_lose_effect": "effect_slain_by_the_sun", "target_part": "arm_r" },
2714-
{ "u_lose_effect": "effect_slain_by_the_sun", "target_part": "leg_l" },
2715-
{ "u_lose_effect": "effect_slain_by_the_sun", "target_part": "leg_r" },
2716-
{ "u_lose_effect": "effect_slain_by_the_sun", "target_part": "torso" },
2717-
{ "u_lose_effect": "effect_slain_by_the_sun", "target_part": "head" },
2718-
{
2719-
"u_message": "The sun's rays cannot reach you anymore. You no longer feel like you're burning alive.",
2720-
"type": "good"
2721-
}
2722-
]
2723-
}
2724-
]
2725-
}
2726-
]
2727-
},
27282672
{
27292673
"type": "effect_on_condition",
27302674
"id": "EOC_ANATHEMA_MIND_CHAOS",

data/mods/Xedra_Evolved/obsoletion_and_migration/eocs.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,5 +137,10 @@
137137
{ "u_lose_effect": "effect_changeling_wearing_iron" },
138138
{ "u_lose_effect": "effect_changeling_wearing_steel" }
139139
]
140+
},
141+
{
142+
"type": "effect_on_condition",
143+
"id": "EOC_SUN_BURN_CHECK",
144+
"effect": [ ]
140145
}
141146
]

doc/JSON/JSON_FLAGS.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,9 @@ Character flags can be `trait_id`, `json_flag_id` or `flag_id`. Some of these a
445445
- ```STOP_SLEEP_DEPRIVATION``` Stops Sleep Deprivation while awake and boosts it while sleeping.
446446
- ```STRICT_HUMANITARIAN``` You can eat foodstuffs tagged with `STRICT_HUMANITARIANISM` without morale penalties.
447447
- ```SUFFOCATION_IMMUNE``` You cannot suffocate by being crushed from multiple enemies.
448-
- ```SUNBURN``` TBD, probably related to `ALBINO`.
448+
- ```SUNBURN``` A worse version of ```ALBINO```, causing you to suffer even more severe damage.
449+
- ```SUNBURN_SUPERNATURAL``` The kind of sun damage that a vampire would suffer, leading to death in minutes.
450+
- ```SUNBURN_SUPERNATURAL_REDUCTION``` Reduces the damage taken by ```SUNBURN_SUPERNATURAL``` by 75%.
449451
- ```SUPER_CLAIRVOYANCE``` Gives a super clairvoyance effect (works with multiple z-levels), used for debug purposes.
450452
- ```SAFECRACK_NO_TOOL``` Allows to open safes without stethoscope.
451453
- ```SUPPRESS_INVISIBILITY``` Any invisibility effects on the creature, including the `PERMANENT_INVISIBILITY` flag, are ignored for the duration of the effect with this flag
@@ -1197,7 +1199,7 @@ Used to describe monster characteristics and set their properties and abilities.
11971199
- ```PATH_AVOID_FALL``` This monster will path around cliffs instead of off of them.
11981200
- ```PATH_AVOID_FIRE``` This monster will path around heat-related dangers instead of through them.
11991201
- ```PAY_BOT``` Creature can be turned into a pet for a limited time in exchange of e-money.
1200-
- ```PERMANENT_INVISIBILITY` The monster is invisible under all circumstances and requires preternatural means to detect. Use with caution
1202+
- ```PERMANENT_INVISIBILITY``` The monster is invisible under all circumstances and requires preternatural means to detect. Use with caution
12011203
- ```PET_HARNESSABLE``` Creature can be attached to a harness.
12021204
- ```PET_MOUNTABLE``` Creature can be ridden or attached to a harness.
12031205
- ```PET_WONT_FOLLOW``` This monster won't follow the player automatically when tamed.

src/suffer.cpp

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ static const json_character_flag json_flag_PAIN_IMMUNE( "PAIN_IMMUNE" );
132132
static const json_character_flag json_flag_RAD_DETECT( "RAD_DETECT" );
133133
static const json_character_flag json_flag_SUFFOCATION_IMMUNE( "SUFFOCATION_IMMUNE" );
134134
static const json_character_flag json_flag_SUNBURN( "SUNBURN" );
135+
static const json_character_flag json_flag_SUNBURN_SUPERNATURAL( "SUNBURN_SUPERNATURAL" );
136+
static const json_character_flag
137+
json_flag_SUNBURN_SUPERNATURAL_REDUCTION( "SUNBURN_SUPERNATURAL_REDUCTION" );
135138

136139
static const morale_type morale_feeling_bad( "morale_feeling_bad" );
137140
static const morale_type morale_feeling_good( "morale_feeling_good" );
@@ -810,8 +813,14 @@ static float heavy_eff_chance( float exp )
810813

811814
void suffer::from_sunburn( Character &you, bool severe )
812815
{
813-
// Sunburn effects and albinism/datura occur about once per minute
814-
if( !one_turn_in( 1_minutes ) ) {
816+
// Sunburn effects and albinism/datura occur about once per minute unless you have the SUNBURN_SUPERNATURAL flag
817+
if( !one_turn_in( 1_minutes ) && !you.has_flag( json_flag_SUNBURN_SUPERNATURAL ) ) {
818+
return;
819+
}
820+
821+
// If you have SUNBURN_SUPERNATURAL but some means of protection, you burn 75% slower
822+
if( !one_turn_in( 4_seconds ) && you.has_flag( json_flag_SUNBURN_SUPERNATURAL ) &&
823+
you.has_flag( json_flag_SUNBURN_SUPERNATURAL_REDUCTION ) ) {
815824
return;
816825
}
817826

@@ -865,16 +874,21 @@ void suffer::from_sunburn( Character &you, bool severe )
865874
bodypart_id bp = bp_exp.first;
866875
float exposure = bp_exp.second;
867876

868-
if( bp == bodypart_id( "eyes" ) ) {
869-
// Sunglasses can keep the sun off the eyes.
877+
if( you.has_flag( json_flag_SUNBURN_SUPERNATURAL ) ) {
878+
exposure = 1;
879+
}
880+
881+
if( bp == bodypart_id( "eyes" ) && !you.has_flag( json_flag_SUNBURN_SUPERNATURAL ) ) {
882+
// Sunglasses can keep the sun off the eyes. SUNBURN_SUPERNATURAL ignores clothing
870883
if( you.has_flag( json_flag_GLARE_RESIST )
871884
|| you.worn_with_flag( flag_SUN_GLASSES )
872885
|| you.worn_with_flag( flag_BLIND ) ) {
873886
continue;
874887
}
875888
// If no UV-/glare-protection gear is worn the eyes should be treated as unprotected
876889
exposure = 1.0;
877-
} else if( ( you.get_wielded_item() && you.get_wielded_item()->has_flag( flag_RAIN_PROTECT ) )
890+
} else if( !you.has_flag( json_flag_SUNBURN_SUPERNATURAL ) && ( ( you.get_wielded_item() &&
891+
you.get_wielded_item()->has_flag( flag_RAIN_PROTECT ) )
878892
|| ( ( bp == body_part_hand_l || bp == body_part_hand_r )
879893
&& you.worn_with_flag( flag_POCKETS )
880894
&& you.can_use_pockets() )
@@ -883,7 +897,7 @@ void suffer::from_sunburn( Character &you, bool severe )
883897
&& you.can_use_hood() )
884898
|| ( bp == body_part_mouth
885899
&& you.worn_with_flag( flag_COLLAR )
886-
&& you.can_use_collar() ) ) {
900+
&& you.can_use_collar() ) ) ) {
887901
// Eyes suffer even in the presence of the checks in this branch!
888902
// Umbrellas can keep the sun off all bodyparts
889903
// Pockets can keep the sun off your hands if you don't wield a too large item

0 commit comments

Comments
 (0)