summaryrefslogtreecommitdiff
path: root/jc_restore-inf-immune.patch
blob: 399702f3a10d3c0d4c9adf19ff9bc36338fa46bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -224,6 +224,7 @@
 
 static const trait_id trait_BADKNEES( "BADKNEES" );
 static const trait_id trait_ILLITERATE( "ILLITERATE" );
+static const trait_id trait_INFIMMUNE( "INFIMMUNE" );
 static const trait_id trait_INFRESIST( "INFRESIST" );
 static const trait_id trait_LEG_TENT_BRACE( "LEG_TENT_BRACE" );
 static const trait_id trait_M_IMMUNE( "M_IMMUNE" );
@@ -9443,8 +9444,11 @@
                          body_part_name_accusative( bp->token ),
                          m.has_flag_ter( "SHARP", dest_loc ) ? m.tername( dest_loc ) : m.furnname(
                              dest_loc ) );
-                if( !u.has_trait( trait_INFRESIST ) ) {
-                    u.add_effect( effect_tetanus, 1_turns, num_bp );
+                if( ( u.has_trait( trait_INFRESIST ) ) && ( one_in( 1024 ) ) ) {
+                    u.add_effect( effect_tetanus, 1_turns, num_bp, true );
+                } else if( ( !u.has_trait( trait_INFIMMUNE ) || !u.has_trait( trait_INFRESIST ) ) &&
+                           ( one_in( 256 ) ) ) {
+                    u.add_effect( effect_tetanus, 1_turns, num_bp, true );
                 }
             }
         }
--- a/src/trapfunc.cpp
+++ b/src/trapfunc.cpp
@@ -50,6 +50,7 @@
 static const efftype_id effect_slimed( "slimed" );
 static const efftype_id effect_tetanus( "tetanus" );
 
+static const trait_id trait_INFIMMUNE( "INFIMMUNE" );
 static const trait_id trait_INFRESIST( "INFRESIST" );
 static const trait_id trait_WINGS_BIRD( "WINGS_BIRD" );
 static const trait_id trait_WINGS_BUTTERFLY( "WINGS_BUTTERFLY" );
@@ -161,8 +162,13 @@
         c->deal_damage( nullptr, hit, d );
 
         player *n = dynamic_cast<player *>( c );
-        if( n != nullptr && !n->has_trait( trait_INFRESIST ) ) {
-            n->add_effect( effect_tetanus, 1_turns, num_bp );
+        if( n != nullptr ) {
+            if( ( n->has_trait( trait_INFRESIST ) ) && ( one_in( 512 ) ) ) {
+                n->add_effect( effect_tetanus, 1_turns, num_bp, true );
+            } else if( ( !n->has_trait( trait_INFIMMUNE ) || !n->has_trait( trait_INFRESIST ) ) &&
+                       ( one_in( 128 ) ) ) {
+                n->add_effect( effect_tetanus, 1_turns, num_bp, true );
+            }
         }
         c->check_dead_state();
     } else {
@@ -196,8 +202,11 @@
     } else {
         c->deal_damage( nullptr, bodypart_id( "foot_l" ), damage_instance( DT_CUT, rng( 6, 10 ) ) );
         c->deal_damage( nullptr, bodypart_id( "foot_r" ), damage_instance( DT_CUT, rng( 6, 10 ) ) );
-        if( !n->has_trait( trait_INFRESIST ) ) {
-            n->add_effect( effect_tetanus, 1_turns, num_bp );
+        if( ( n->has_trait( trait_INFRESIST ) ) && ( one_in( 256 ) ) ) {
+            n->add_effect( effect_tetanus, 1_turns, num_bp, true );
+        } else if( ( !n->has_trait( trait_INFIMMUNE ) || !n->has_trait( trait_INFRESIST ) ) &&
+                   ( one_in( 35 ) ) ) {
+            n->add_effect( effect_tetanus, 1_turns, num_bp, true );
         }
     }
     c->check_dead_state();
@@ -855,8 +864,11 @@
             n->add_msg_if_player( m_bad, _( "The spikes impale your %s!" ),
                                   body_part_name_accusative( hit->token ) );
             n->deal_damage( nullptr, hit, damage_instance( DT_CUT, damage ) );
-            if( !n->has_trait( trait_INFRESIST ) ) {
-                n->add_effect( effect_tetanus, 1_turns, num_bp );
+            if( ( n->has_trait( trait_INFRESIST ) ) && ( one_in( 256 ) ) ) {
+                n->add_effect( effect_tetanus, 1_turns, num_bp, true );
+            } else if( ( !n->has_trait( trait_INFIMMUNE ) || !n->has_trait( trait_INFRESIST ) ) &&
+                       ( one_in( 35 ) ) ) {
+                n->add_effect( effect_tetanus, 1_turns, num_bp, true );
             }
         }
     } else if( z != nullptr ) {
@@ -939,8 +951,11 @@
             n->add_msg_if_player( m_bad, _( "The glass shards slash your %s!" ),
                                   body_part_name_accusative( hit->token ) );
             n->deal_damage( nullptr, hit, damage_instance( DT_CUT, damage ) );
-            if( !n->has_trait( trait_INFRESIST ) ) {
-                n->add_effect( effect_tetanus, 1_turns, num_bp );
+            if( ( n->has_trait( trait_INFRESIST ) ) && ( one_in( 256 ) ) ) {
+                n->add_effect( effect_tetanus, 1_turns, num_bp, true );
+            } else if( ( !n->has_trait( trait_INFIMMUNE ) || !n->has_trait( trait_INFRESIST ) ) &&
+                       ( one_in( 35 ) ) ) {
+                n->add_effect( effect_tetanus, 1_turns, num_bp, true );
             }
         }
     } else if( z != nullptr ) {
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -84,6 +84,7 @@
 #include "weather_gen.h"
 
 static const efftype_id effect_adrenaline( "adrenaline" );
+static const efftype_id effect_bite( "bite" );
 static const efftype_id effect_blind( "blind" );
 static const efftype_id effect_bloodworms( "bloodworms" );
 static const efftype_id effect_boomered( "boomered" );
@@ -93,12 +94,14 @@
 static const efftype_id effect_downed( "downed" );
 static const efftype_id effect_drunk( "drunk" );
 static const efftype_id effect_fungus( "fungus" );
+static const efftype_id effect_infected( "infected" );
 static const efftype_id effect_masked_scent( "masked_scent" );
 static const efftype_id effect_meth( "meth" );
 static const efftype_id effect_narcosis( "narcosis" );
 static const efftype_id effect_nausea( "nausea" );
 static const efftype_id effect_onfire( "onfire" );
 static const efftype_id effect_paincysts( "paincysts" );
+static const efftype_id effect_recover( "recover" );
 static const efftype_id effect_sleep( "sleep" );
 static const efftype_id effect_stunned( "stunned" );
 static const efftype_id effect_tapeworm( "tapeworm" );
@@ -125,6 +128,7 @@
 static const trait_id trait_FAT( "FAT" );
 static const trait_id trait_FELINE_FUR( "FELINE_FUR" );
 static const trait_id trait_FUR( "FUR" );
+static const trait_id trait_INFIMMUNE( "INFIMMUNE" );
 static const trait_id trait_INSOMNIA( "INSOMNIA" );
 static const trait_id trait_INT_SLIME( "INT_SLIME" );
 static const trait_id trait_LIGHTFUR( "LIGHTFUR" );
@@ -1660,6 +1664,12 @@
         remove_effect( effect_tapeworm );
         add_msg_if_player( m_good, _( "Your bowels gurgle as something inside them dies." ) );
     }
+    if( has_trait( trait_INFIMMUNE ) && ( has_effect( effect_bite ) || has_effect( effect_infected ) ||
+                                          has_effect( effect_recover ) ) ) {
+        remove_effect( effect_bite );
+        remove_effect( effect_infected );
+        remove_effect( effect_recover );
+    }
 
     //Human only effects
     for( auto &elem : *effects ) {
--- a/data/json/mutations/mutations.json
+++ b/data/json/mutations/mutations.json
@@ -2538,10 +2538,11 @@
   {
     "type": "mutation",
     "id": "INFRESIST",
-    "name": { "str": "Infection Immune" },
-    "points": 1,
-    "description": "Your immune system is particularly good at resisting infections.  Your wounds will no longer become infected, altough existing infections are still dangerous.",
+    "name": { "str": "Infection Resistant" },
+    "points": 2,
+    "description": "Your immune system is particularly good at resisting infections.  You have an increased chance for bad wounds and infections to heal on their own, and only suffer reduced penalties from them.",
     "starting_trait": true,
+    "changes_to": [ "INFIMMUNE" ],
     "category": [ "TROGLOBITE", "RAT", "MEDICAL" ]
   },
   {