Attached Files:
|
0001-Brands-are-known-when-weilded-by-monsters.patch [^] (4,028 bytes) 2014-06-15 01:16 [Show Content] [Hide Content]From 97ee239b5ba7390139e011a805fdf734134e6beb Mon Sep 17 00:00:00 2001
From: Aj <aj.k.adamson@gmail.com>
Date: Sat, 14 Jun 2014 16:50:39 -0600
Subject: [PATCH] Brands are known when weilded by monsters. Makes it so that
players can make informed decisions. If you need random use the chaos brand.
---
crawl-ref/source/mon-gear.cc | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/crawl-ref/source/mon-gear.cc b/crawl-ref/source/mon-gear.cc
index c80a252..c3800b0 100644
--- a/crawl-ref/source/mon-gear.cc
+++ b/crawl-ref/source/mon-gear.cc
@@ -245,6 +245,9 @@ static void _give_weapon(monster* mon, int level, bool melee_only = false,
// moved setting of quantity here to keep it in mind {dlb}
item.quantity = 1;
+ // Always know brand so player can make good decisions. Chaos brand exists if you want rng.
+ item.flags |= ISFLAG_KNOW_TYPE;
+
if (spectral_orcs)
type = mon->number;
@@ -444,7 +447,6 @@ static void _give_weapon(monster* mon, int level, bool melee_only = false,
set_item_ego_type(item, OBJ_WEAPONS, SPWPN_CHAOS);
item.plus += 2 + random2(3);
item.plus2 += 2 + random2(3);
- item.flags |= ISFLAG_KNOW_TYPE;
break;
case MONS_JOSEPH:
@@ -834,7 +836,6 @@ static void _give_weapon(monster* mon, int level, bool melee_only = false,
item.sub_type = WPN_TRIDENT;
item.plus = random_range(-1, 6, 2);
item.plus2 = random_range(-1, 6, 2);
- item.flags |= ISFLAG_KNOW_TYPE;
set_item_ego_type(item, OBJ_WEAPONS, SPWPN_FREEZING);
break;
@@ -913,7 +914,6 @@ static void _give_weapon(monster* mon, int level, bool melee_only = false,
item.sub_type = WPN_LONGBOW;
item.plus += 1 + random2(3);
item.plus2 += 1 + random2(3);
- item.flags |= ISFLAG_KNOW_TYPE;
set_item_ego_type(item, OBJ_WEAPONS, SPWPN_FLAMING);
break;
@@ -931,7 +931,6 @@ static void _give_weapon(monster* mon, int level, bool melee_only = false,
item.sub_type = WPN_SCIMITAR;
item.plus = random2(5);
item.plus2 = random2(5);
- item.flags |= ISFLAG_KNOW_TYPE;
set_item_ego_type(item, OBJ_WEAPONS, SPWPN_FLAMING);
break;
@@ -1100,14 +1099,12 @@ static void _give_weapon(monster* mon, int level, bool melee_only = false,
case MONS_FIRE_GIANT:
item.base_type = OBJ_WEAPONS;
item.sub_type = WPN_GREAT_SWORD;
- item.flags |= ISFLAG_KNOW_TYPE;
item.special = SPWPN_FLAMING;
break;
case MONS_FROST_GIANT:
item.base_type = OBJ_WEAPONS;
item.sub_type = WPN_BATTLEAXE;
- item.flags |= ISFLAG_KNOW_TYPE;
item.special = SPWPN_FREEZING;
break;
@@ -1211,7 +1208,6 @@ static void _give_weapon(monster* mon, int level, bool melee_only = false,
set_item_ego_type(item, OBJ_WEAPONS, SPWPN_ELECTROCUTION);
item.plus = random2(5);
item.plus2 = random2(5);
- item.flags |= ISFLAG_KNOW_TYPE;
if (one_chance_in(100) && !get_unique_item_status(UNRAND_ARC_BLADE))
make_item_unrandart(item, UNRAND_ARC_BLADE);
break;
@@ -1220,7 +1216,6 @@ static void _give_weapon(monster* mon, int level, bool melee_only = false,
force_item = true;
item.base_type = OBJ_STAVES;
item.sub_type = STAFF_POISON;
- item.flags |= ISFLAG_KNOW_TYPE;
if (one_chance_in(100) && !get_unique_item_status(UNRAND_OLGREB))
make_item_unrandart(item, UNRAND_OLGREB);
break;
@@ -1366,7 +1361,6 @@ static void _give_weapon(monster* mon, int level, bool melee_only = false,
set_item_ego_type(item, OBJ_WEAPONS, SPWPN_PAIN);
item.plus = 2 + random2(7);
item.plus2 = 2 + random2(7);
- item.flags |= ISFLAG_KNOW_TYPE;
break;
case MONS_HELLBINDER:
--
1.8.3.msysgit.0
0001-Picked-up-vault-spawned-weapons-now-have-known-brand.patch [^] (2,429 bytes) 2014-06-15 03:52 [Show Content] [Hide Content]From b90e6f51b4e2cfedba9901f3a2eefbec235047c3 Mon Sep 17 00:00:00 2001
From: Aj <aj.k.adamson@gmail.com>
Date: Sat, 14 Jun 2014 19:46:51 -0600
Subject: [PATCH] Picked up/vault spawned weapons now have known brands Zombie
weapons ensured to have known brands.
---
crawl-ref/source/mon-abil.cc | 1 +
crawl-ref/source/monster.cc | 22 +++++++++++++---------
2 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/crawl-ref/source/mon-abil.cc b/crawl-ref/source/mon-abil.cc
index d8fefcd..611922e 100644
--- a/crawl-ref/source/mon-abil.cc
+++ b/crawl-ref/source/mon-abil.cc
@@ -2009,6 +2009,7 @@ bool lost_soul_spectralize(monster* mons)
mitm[new_index] = mitm[old_index];
mitm[new_index].set_holding_monster(mi->mindex());
mitm[new_index].flags |= ISFLAG_SUMMONED;
+ mitm[new_index].flags |= ISFLAG_KNOW_TYPE;
// Make holy items plain
if (get_weapon_brand(mitm[new_index]) == SPWPN_HOLY_WRATH)
diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc
index 5804d90..468ed0f 100644
--- a/crawl-ref/source/monster.cc
+++ b/crawl-ref/source/monster.cc
@@ -867,9 +867,10 @@ void monster::equip_weapon(item_def &item, int near, bool msg)
if (brand == SPWPN_EVASION)
ev += 5;
+ bool nobrand_ranged = false;
if (msg)
{
- bool message_given = true;
+
switch (brand)
{
case SPWPN_FLAMING:
@@ -912,16 +913,19 @@ void monster::equip_weapon(item_def &item, int near, bool msg)
default:
// A ranged weapon without special message is known to be unbranded.
if (brand != SPWPN_NORMAL || !is_range_weapon(item))
- message_given = false;
+ nobrand_ranged = true;
}
- if (message_given)
- {
- if (is_artefact(item) && !is_special_unrandom_artefact(item))
- artefact_wpn_learn_prop(item, ARTP_BRAND);
- else
- set_ident_flags(item, ISFLAG_KNOW_TYPE);
- }
+
+ }
+
+ // don't need to know about unbranded range weapons.
+ if (!nobrand_ranged)
+ {
+ if (is_artefact(item) && !is_special_unrandom_artefact(item))
+ artefact_wpn_learn_prop(item, ARTP_BRAND);
+ else
+ set_ident_flags(item, ISFLAG_KNOW_TYPE);
}
}
--
1.8.3.msysgit.0
0001-unset-ISFLAG_TYPE-on-unseen-unequipped-weapons.patch [^] (2,233 bytes) 2014-06-24 01:31 [Show Content] [Hide Content]From 5f8e33109eecd47046500212cb2f3748dc9ebdc2 Mon Sep 17 00:00:00 2001
From: Aj Adamson <aj.k.adamson@gmail.com>
Date: Mon, 23 Jun 2014 17:27:54 -0600
Subject: [PATCH] unset ISFLAG_TYPE on unseen unequipped weapons. randarts
don't get brand id'd on monster wield out of sight.
---
crawl-ref/source/monster.cc | 28 ++++++++++++----------------
1 file changed, 12 insertions(+), 16 deletions(-)
diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc
index 3a991c2..9860ac6 100644
--- a/crawl-ref/source/monster.cc
+++ b/crawl-ref/source/monster.cc
@@ -914,17 +914,13 @@ void monster::equip_weapon(item_def &item, int near, bool msg)
nobrand_ranged = true;
}
-
- }
-
- // don't need to know about unbranded range weapons.
- if (!nobrand_ranged)
- {
- if (is_artefact(item) && !is_special_unrandom_artefact(item))
+ // artefacts set props
+ if (!nobrand_ranged && is_artefact(item) && !is_special_unrandom_artefact(item))
artefact_wpn_learn_prop(item, ARTP_BRAND);
- else
- set_ident_flags(item, ISFLAG_KNOW_TYPE);
}
+
+ if (!nobrand_ranged && !is_artefact(item))
+ set_ident_flags(item, ISFLAG_KNOW_TYPE);
}
int monster::armour_bonus(const item_def &item)
@@ -1074,15 +1070,15 @@ void monster::unequip_weapon(item_def &item, int near, bool msg)
default:
message_given = false;
}
- if (message_given)
- {
- if (is_artefact(item) && !is_special_unrandom_artefact(item))
- artefact_wpn_learn_prop(item, ARTP_BRAND);
- else
- set_ident_flags(item, ISFLAG_KNOW_TYPE);
- }
+
+ if (message_given && is_artefact(item) && !is_special_unrandom_artefact(item))
+ artefact_wpn_learn_prop(item, ARTP_BRAND);
}
+ // !msg probably not needed as seen flag should be set but we'll make sure the monster isn't in sight
+ if (!item_ident(item, ISFLAG_SEEN) && !msg)
+ unset_ident_flags(item, ISFLAG_KNOW_TYPE);
+
monster *spectral_weapon = find_spectral_weapon(this);
if (spectral_weapon)
end_spectral_weapon(spectral_weapon, false);
--
1.9.1
|