Skip to content

Commit

Permalink
Merge pull request CleverRaven#6898 from KA101/MoreBear
Browse files Browse the repository at this point in the history
Mutation tweaking (mostly Ursine)
  • Loading branch information
Rivet-the-Zombie committed Mar 25, 2014
2 parents ddf211c + 11cccf0 commit 711cac2
Show file tree
Hide file tree
Showing 6 changed files with 135 additions and 48 deletions.
26 changes: 25 additions & 1 deletion data/json/mutations.json
Original file line number Diff line number Diff line change
Expand Up @@ -1165,8 +1165,20 @@
"ugliness" : 3,
"description" : "Thick black fur has grown to cover your entire body, providing a marginal protection against attacks, and considerable protection from cold.",
"cancels" : ["SCALES", "FEATHERS", "CHITIN", "PLANTSKIN", "FELINE_FUR", "LUPINE_FUR"],
"changes_to" : ["URSINE_FUR"],
"prereqs" : ["LIGHTFUR"],
"category" : ["MUTCAT_BEAST", "MUTCAT_CATTLE", "MUTCAT_RAT", "MUTCAT_SPIDER", "MUTCAT_URSINE"]
},{
"type" : "mutation",
"id" : "URSINE_FUR",
"name" : "Shaggy Fur",
"points" : 4,
"visibility" : 10,
"ugliness" : 3,
"description" : "Your thick fur has grown out, providing noticeable protection from attacks in addition to its considerable insulation.",
"cancels" : ["SCALES", "FEATHERS", "CHITIN", "PLANTSKIN", "FELINE_FUR", "LUPINE_FUR"],
"prereqs" : ["FUR"],
"category" : ["MUTCAT_URSINE"]
},{
"type" : "mutation",
"id" : "LUPINE_FUR",
Expand Down Expand Up @@ -1350,7 +1362,7 @@
"prereqs" : ["NAILS"],
"changes_to" : ["CLAWS_RETRACT"],
"cancels" : ["TALONS"],
"category" : ["MUTCAT_BEAST", "MUTCAT_RAT", "MUTCAT_RAPTOR"]
"category" : ["MUTCAT_BEAST", "MUTCAT_RAT", "MUTCAT_RAPTOR", "MUTCAT_URSINE"]
},{
"type" : "mutation",
"id" : "CLAWS_RETRACT",
Expand Down Expand Up @@ -1870,6 +1882,7 @@
"description" : "You've developed the ability to stockpile calories and then sleep for extended periods of time.",
"valid" : false,
"prereqs" : ["HEAVYSLEEPER2"],
"prereqs2" : ["FAT"],
"threshreq" : ["THRESH_URSINE"],
"category" : ["MUTCAT_URSINE"]
},{
Expand Down Expand Up @@ -2157,6 +2170,17 @@
"ugliness" : 1,
"description" : "You have a set of prominent rodent-like whiskers around your mouth. These make you more aware of vibrations in the air, and improve your ability to dodge very slightly.",
"category" : ["MUTCAT_RAT", "MUTCAT_FELINE"]
},{
"type" : "mutation",
"id" : "FAT",
"name" : "Fat Deposits",
"points" : 1,
"visibility" : 1,
"ugliness" : 1,
"description" : "You've put on some additional weight around your body. It slows you down a little, but helps your swimming and warmth.",
"prereqs" : ["STR_UP", "STR_UP_2", "STR_UP_3", "STR_UP_4"],
"leads_to" : ["HIBERNATE"],
"category" : ["MUTCAT_URSINE"]
},{
"type" : "mutation",
"id" : "LARGE",
Expand Down
2 changes: 1 addition & 1 deletion src/bionics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ void player::activate_bionic(int b)
if (has_disease("brainworm")) { // This little guy is immune to the blood filter too, as he lives in your brain.
good.push_back(_("Intracranial Parasite"));
}
if (has_disease("paincysts")) { // These little guys are immune to the blood filter too, as they lives in your muscles.
if (has_disease("paincysts")) { // These little guys are immune to the blood filter too, as they live in your muscles.
good.push_back(_("Intramuscular Parasites"));
}
if (good.empty() && bad.empty()) {
Expand Down
16 changes: 13 additions & 3 deletions src/disease.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,18 @@ void dis_effect(player &p, disease &dis)
int bonus;
dis_type_enum disType = disease_type_lookup[dis.type];
int grackPower = 500;
bool inflictBadPsnPain = (!p.has_trait("POISRESIST") && one_in(100)) ||
(p.has_trait("POISRESIST") && one_in(500));
int BMB = 0; // Body Mass Bonus
if (p.has_trait("FAT")) {
BMB += 25;
}
if (p.has_trait("LARGE") || p.has_trait("LARGE_OK")) {
BMB += 100;
}
if (p.has_trait("HUGE") || p.has_trait("HUGE_OK")) {
BMB += 200;
}
bool inflictBadPsnPain = (!p.has_trait("POISRESIST") && one_in(100 + BMB)) ||
(p.has_trait("POISRESIST") && one_in(500 + BMB));
switch(disType) {
case DI_COLD:
switch(dis.bp) {
Expand Down Expand Up @@ -951,7 +961,7 @@ void dis_effect(player &p, disease &dis)
break;

case DI_TAPEWORM:
if (p.has_trait("PARAIMMUNE")) {
if (p.has_trait("PARAIMMUNE") || p.has_trait("EATHEALTH")) {
p.rem_disease("tapeworm");
} else {
if(one_in(512)) {
Expand Down
13 changes: 9 additions & 4 deletions src/iuse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,9 @@ int iuse::atomic_caff(player *p, item *it, bool)

int iuse::raw_meat(player *p, item *it, bool)
{
if ((one_in(32)) && !(p->has_disease("tapeworm") || p->has_bionic("bio_digestion") || p->has_trait("PARAIMMUNE"))) {
if ((one_in(32)) && !(p->has_disease("tapeworm") || p->has_bionic("bio_digestion") || p->has_trait("PARAIMMUNE") ||
// Hyper-Metabolism digests the thing before it can set up shop.
p->has_trait("EATHEALTH"))) {
p->add_disease("tapeworm", 1, true);
} if ((one_in(64)) && !(p->has_disease("bloodworms") || p->has_bionic("bio_digestion") || p->has_trait("PARAIMMUNE"))) {
p->add_disease("bloodworms", 1, true);
Expand All @@ -687,7 +689,8 @@ int iuse::raw_meat(player *p, item *it, bool)

int iuse::raw_fat(player *p, item *it, bool)
{
if ((one_in(64)) && !(p->has_disease("tapeworm") || p->has_bionic("bio_digestion") || p->has_trait("PARAIMMUNE"))) {
if ((one_in(64)) && !(p->has_disease("tapeworm") || p->has_bionic("bio_digestion") || p->has_trait("PARAIMMUNE") ||
p->has_trait("EATHEALTH"))) {
p->add_disease("tapeworm", 1, true);
} if ((one_in(128)) && !(p->has_disease("bloodworms") || p->has_bionic("bio_digestion") || p->has_trait("PARAIMMUNE"))) {
p->add_disease("bloodworms", 1, true);
Expand All @@ -707,7 +710,8 @@ int iuse::raw_bone(player *p, item *it, bool)

int iuse::raw_fish(player *p, item *it, bool)
{
if ((one_in(256)) && !(p->has_disease("tapeworm") || p->has_bionic("bio_digestion") || p->has_trait("PARAIMMUNE"))) {
if ((one_in(256)) && !(p->has_disease("tapeworm") || p->has_bionic("bio_digestion") || p->has_trait("PARAIMMUNE") ||
p->has_trait("EATHEALTH"))) {
p->add_disease("tapeworm", 1, true);
} if ((one_in(256)) && !(p->has_disease("bloodworms") || p->has_bionic("bio_digestion") || p->has_trait("PARAIMMUNE"))) {
p->add_disease("bloodworms", 1, true);
Expand All @@ -721,7 +725,8 @@ int iuse::raw_fish(player *p, item *it, bool)

int iuse::raw_wildveg(player *p, item *it, bool)
{
if ((one_in(512)) && !(p->has_disease("tapeworm") || p->has_bionic("bio_digestion") || p->has_trait("PARAIMMUNE"))) {
if ((one_in(512)) && !(p->has_disease("tapeworm") || p->has_bionic("bio_digestion") || p->has_trait("PARAIMMUNE") ||
p->has_trait("EATHEALTH"))) {
p->add_disease("tapeworm", 1, true);
} if ((one_in(256)) && !(p->has_disease("bloodworms") || p->has_bionic("bio_digestion") || p->has_trait("PARAIMMUNE"))) {
p->add_disease("bloodworms", 1, true);
Expand Down
3 changes: 1 addition & 2 deletions src/mutation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,9 @@ void player::mutate_towards(std::string mut)
}

// No crossing The Threshold by simply not having it
// Reroll mutation, uncategorized (prevents looping)
// Rerolling proved more trouble than it was worth, so deleted
if (!has_threshreq && !threshreq.empty()) {
g->add_msg(_("You feel something straining deep inside you, yearning to be free..."));
mutate();
return;
}

Expand Down
123 changes: 86 additions & 37 deletions src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1034,8 +1034,8 @@ void player::update_bodytemp()
{
temp_conv[i] += (temp_cur[i] > BODYTEMP_NORM ? 250 : 500);
}
// Furry or Lupine Fur
if (has_trait("FUR") || has_trait("LUPINE_FUR"))
// Furry or Lupine/Ursine Fur
if (has_trait("FUR") || has_trait("LUPINE_FUR") || has_trait("URSINE_FUR"))
{
temp_conv[i] += (temp_cur[i] > BODYTEMP_NORM ? 750 : 1500);
}
Expand All @@ -1050,6 +1050,11 @@ void player::update_bodytemp()
{
temp_conv[i] += (temp_cur[i] > BODYTEMP_NORM ? 300 : 800);
}
// Fat deposits don't hold in much heat, but don't shift for temp
if (has_trait("DOWN"))
{
temp_conv[i] += (temp_cur[i] > BODYTEMP_NORM ? 200 : 200);
}
// Disintegration
if (has_trait("ROT1")) { temp_conv[i] -= 250;}
else if (has_trait("ROT2")) { temp_conv[i] -= 750;}
Expand Down Expand Up @@ -1392,6 +1397,9 @@ int player::run_cost(int base_cost, bool diag)
if (has_trait("LEG_TENTACLES")) {
movecost += 20;
}
if (has_trait("FAT")) {
movecost *= 1.05f;
}
if (has_trait("PONDEROUS1")) {
movecost *= 1.1f;
}
Expand Down Expand Up @@ -1424,18 +1432,27 @@ int player::run_cost(int base_cost, bool diag)
int player::swim_speed()
{
int ret = 440 + weight_carried() / 60 - 50 * skillLevel("swimming");
if (has_trait("PAWS"))
ret -= 15 + str_cur * 4;
if (is_wearing("swim_fins"))
ret -= (10 * str_cur) * 1.5;
if (has_trait("WEBBED"))
ret -= 60 + str_cur * 5;
if (has_trait("TAIL_FIN"))
ret -= 100 + str_cur * 10;
if (has_trait("SLEEK_SCALES"))
ret -= 100;
if (has_trait("LEG_TENTACLES"))
ret -= 60;
if (has_trait("PAWS")) {
ret -= 15 + str_cur * 4;
}
if (is_wearing("swim_fins")) {
ret -= (10 * str_cur) * 1.5;
}
if (has_trait("WEBBED")) {
ret -= 60 + str_cur * 5;
}
if (has_trait("TAIL_FIN")) {
ret -= 100 + str_cur * 10;
}
if (has_trait("SLEEK_SCALES")) {
ret -= 100;
}
if (has_trait("LEG_TENTACLES")) {
ret -= 60;
}
if (has_trait("FAT")) {
ret -= 30;
}
ret += (50 - skillLevel("swimming") * 2) * encumb(bp_legs);
ret += (80 - skillLevel("swimming") * 3) * encumb(bp_torso);
if (skillLevel("swimming") < 10) {
Expand Down Expand Up @@ -5105,6 +5122,16 @@ void player::process_effects() {
mod_str_bonus(-2);
mod_per_bonus(-1);
}
// Increased body mass means poison's less effective
if (has_trait("FAT")) {
psnChance *= 1.5;
}
if (has_trait("LARGE") || has_trait("LARGE_OK")) {
psnChance *= 2;
}
if (has_trait("HUGE") || has_trait("HUGE_OK")) {
psnChance *= 3;
}
if ((one_in(psnChance)) && (!(has_trait("NOPAIN")))) {
g->add_msg_if_player(this,_("You're suddenly wracked with pain!"));
mod_pain(1);
Expand Down Expand Up @@ -5856,6 +5883,11 @@ void player::drench(int saturation, int flags)
dur /= 5;
d_start /= 5;
}
// Shaggy fur holds water longer. :-/
if (has_trait("URSINE_FUR")) {
dur /= 3;
d_start /= 3;
}
} else {
if (has_trait("SLIMY")) {
dur *= 1.2;
Expand Down Expand Up @@ -7475,8 +7507,9 @@ bool player::eat(item *eaten, it_comest *comest)
return false;
}
} else {
if ( ( comest->quench > 0 && temp_thirst < capacity ) && ( (!(has_trait("EATHEALTH"))) ||
(!(has_trait("SLIMESPAWNER"))) ) ) {
if ( (( comest->nutr > 0 && temp_hunger < capacity ) ||
( comest->quench > 0 && temp_thirst < capacity )) &&
( (!(has_trait("EATHEALTH"))) || (!(has_trait("SLIMESPAWNER"))) ) ) {
if (!query_yn(_("You will not be able to finish it all. Consume it?"))) {
return false;
}
Expand Down Expand Up @@ -9357,26 +9390,39 @@ int player::get_armor_bash_base(body_part bp)
if (armor->covers & mfb(bp))
ret += worn[i].bash_resist();
}
if (has_bionic("bio_carbon"))
ret += 2;
if (bp == bp_head && has_bionic("bio_armor_head"))
ret += 3;
else if (bp == bp_arms && has_bionic("bio_armor_arms"))
ret += 3;
else if (bp == bp_torso && has_bionic("bio_armor_torso"))
ret += 3;
else if (bp == bp_legs && has_bionic("bio_armor_legs"))
ret += 3;
else if (bp == bp_eyes && has_bionic("bio_armor_eyes"))
ret += 3;
if (has_trait("FUR") || has_trait("LUPINE_FUR"))
ret++;
if (bp == bp_head && has_trait("LYNX_FUR"))
ret++;
if (has_trait("CHITIN"))
ret += 2;
if (has_trait("SHELL") && bp == bp_torso)
ret += 6;
if (has_bionic("bio_carbon")) {
ret += 2;
}
if (bp == bp_head && has_bionic("bio_armor_head")) {
ret += 3;
}
if (bp == bp_arms && has_bionic("bio_armor_arms")) {
ret += 3;
}
if (bp == bp_torso && has_bionic("bio_armor_torso")) {
ret += 3;
}
if (bp == bp_legs && has_bionic("bio_armor_legs")) {
ret += 3;
}
if (bp == bp_eyes && has_bionic("bio_armor_eyes")) {
ret += 3;
}
if (has_trait("FUR") || has_trait("LUPINE_FUR") || has_trait("URSINE_FUR")) {
ret++;
}
if (bp == bp_head && has_trait("LYNX_FUR")) {
ret++;
}
if (has_trait("FAT")) {
ret ++;
}
if (has_trait("CHITIN")) {
ret += 2;
}
if (has_trait("SHELL") && bp == bp_torso) {
ret += 6;
}
ret += rng(0, disease_intensity("armor_boost"));
return ret;
}
Expand Down Expand Up @@ -9703,12 +9749,15 @@ void player::absorb(body_part bp, int &dam, int &cut)
if (bp == bp_arms && has_trait("ARM_FEATHERS")) {
dam--;
}
if (has_trait("FUR") || has_trait("LUPINE_FUR")) {
if (has_trait("FUR") || has_trait("LUPINE_FUR") || has_trait("URSINE_FUR")) {
dam--;
}
if (bp == bp_head && has_trait("LYNX_FUR")) {
dam--;
}
if (has_trait("FAT")) {
cut --;
}
if (has_trait("CHITIN")) {
cut -= 2;
}
Expand Down

0 comments on commit 711cac2

Please sign in to comment.