Special thanks to: Jaso11111(for the idea itself) and Kevin Granade(for clearing up my messy code)
As i can’t figure out how to use github and if the change was merged with the source code or not, here are pieces of code that you probably’ll need to change to make this mod work(wall of text ahead):
- in iuse.cpp replace manhack’s code with this:
int iuse::minion(player *p, item *corpse, bool)
{
// TODO: stash these strings in the item definition so they aren't hard-coded here.
std::string minion_type;
std::string skill_one;
std::string skill_two;
std::string failure;
std::string success;
if( corpse->type->id == "minion_dormant" ) {
minion_type = "mon_zombie";
skill_one = "survival";
skill_two = "firstaid";
failure = _("Your %s shakes uncontrollably and turns hostile!");
success = _("Your %s awakes from it's slumber and surveys the area!");
} else if ( corpse->type->id == "blob_dormant" ) {
minion_type = "mon_blob";
skill_one = "survival";
skill_two = "firstaid";
failure = _("Your %s shakes uncontrollably and turns hostile!");
success = _("Your %s awakes from it's slumber and surveys the area!");
} else if ( corpse->type->id == "bot_manhack" ) {
minion_type = "mon_manhack";
skill_one = "electronics";
skill_two = "computer";
failure = _("You misprogram the %s; it's hostile!");
success = _("The %s flies from your hand and surveys the area!");
}
std::vector<point> valid; // Valid spawn locations
for (int x = p->posx - 1; x <= p->posx + 1; x++) {
for (int y = p->posy - 1; y <= p->posy + 1; y++) {
if (g->is_empty(x, y)) {
valid.push_back(point(x, y));
}
}
}
monster minion( GetMType( minion_type ) );
if (valid.empty()) { // No valid points!
p->add_msg_if_player( m_info, _("There is no adjacent square to release your %s in!"),
minion.name().c_str() );
return 0;
}
int index = rng(0, valid.size() - 1);
p->moves -= 60;
minion.setpos( valid[index].x, valid[index].y, true );
if (rng(0, p->int_cur / 2) + p->skillLevel( skill_one) / 2 +
p->skillLevel( skill_two ) < rng(0, 4)) {
p->add_msg_if_player( m_bad, failure.c_str(), minion.name().c_str() );
} else {
p->add_msg_if_player( m_good, success.c_str(), minion.name().c_str() );
minion.friendly = -1;
}
g->add_zombie( minion );
return 1;
}
2. In iuse.h replace:
with:
- in tools.json change manhack’s use_action to "MINION"
After that just download the mod from here: .zip]http://www.mediafire.com/download/67ptpwmkcvyl87d/Necromancy_Mod[WIP].zip (Yeah, i know the link looks weird)
It might be buggy and it certainly is unbalanced - that’s why it’s a work in progress.
I plan on adding new minions and other items so all advice on balancing, bug reports and suggestions are welcome.
Recent changes:
-The blobs require the control chip as intended
-The recipe for dormant blobs should now work without wasting materials