summaryrefslogtreecommitdiff
path: root/backport-09_feat-balance-MILITARY_MECH-flag-affects-ID-card-need.patch
blob: e08411bdfe8c33b53d84ea05a17294ac2e24b362 (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
From f73f0d1a09f44aee8c8be75d12fed308ba779997 Mon Sep 17 00:00:00 2001
From: Chaosvolt <chaosvolt@users.noreply.github.com>
Date: Fri, 17 Nov 2023 07:09:19 -0600
Subject: [PATCH] feat(balance): MILITARY_MECH flag affects ID card needed, fix
 duplicate message (#3697)

* feat(balance): MILITARY_MECH flag affects ID card needed, fix duplicate message

* Fix the thing
---
 data/json/monsters/mechsuits.json | 1 -
 src/character.cpp                 | 1 -
 src/monexamine.cpp                | 8 +++++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/data/json/monsters/mechsuits.json b/data/json/monsters/mechsuits.json
index 3bdc8f061a4..3f169a5c668 100644
--- a/data/json/monsters/mechsuits.json
+++ b/data/json/monsters/mechsuits.json
@@ -134,7 +134,6 @@
     "flags": [
       "SEES",
       "HEARS",
-      "MILITARY_MECH",
       "BASHES",
       "PUSH_VEH",
       "PUSH_MON",
diff --git a/src/character.cpp b/src/character.cpp
index c5b903133ac..6d8d9335c9c 100644
--- a/src/character.cpp
+++ b/src/character.cpp
@@ -1364,7 +1364,6 @@ void Character::mount_creature( monster &z )
             }
             add_msg_if_player( m_good, _( "You hear your %s whir to life." ), z.get_name() );
         }
-        add_msg_if_player( m_good, _( "You hear your %s whir to life." ), z.get_name() );
     }
     // some rideable mechs have night-vision
     recalc_sight_limits();
diff --git a/src/monexamine.cpp b/src/monexamine.cpp
index 2dc423d10b1..4be13ab25aa 100644
--- a/src/monexamine.cpp
+++ b/src/monexamine.cpp
@@ -58,6 +58,7 @@ static const efftype_id effect_led_by_leash( "led_by_leash" );
 static const efftype_id effect_tied( "tied" );
 
 static const itype_id itype_cash_card( "cash_card" );
+static const itype_id itype_id_industrial( "id_industrial" );
 static const itype_id itype_id_military( "id_military" );
 
 static const skill_id skill_survival( "survival" );
@@ -430,10 +431,10 @@ void monexamine::insert_battery( monster &z )
 
 bool monexamine::mech_hack( monster &z )
 {
-    itype_id card_type = itype_id_military;
+    itype_id card_type = ( z.has_flag( MF_MILITARY_MECH ) ? itype_id_military : itype_id_industrial );
     avatar &you = get_avatar();
     if( you.has_amount( card_type, 1 ) ) {
-        if( query_yn( _( "Swipe your ID card into the mech's security port?" ) ) ) {
+        if( query_yn( _( "Swipe your %s into the mech's security port?" ), item::nname( card_type ) ) ) {
             you.mod_moves( -100 );
             z.add_effect( effect_pet, 1_turns, num_bp );
             z.friendly = -1;
@@ -443,7 +444,8 @@ bool monexamine::mech_hack( monster &z )
             return true;
         }
     } else {
-        add_msg( m_info, _( "You do not have the required ID card to activate this mech." ) );
+        add_msg( m_info, _( "You do not have the required %s to activate this mech." ),
+                 item::nname( card_type ) );
     }
     return false;
 }
-- 
2.42.0