Welcome to the Builder Academy

Question Forge too OP how to balance?

More
26 Sep 2022 19:37 #10166 by Nero
I put in forge but it seems to be upping the damage by way too much on our weapons.
I would like to dial it down some but unsure of the best way how.
I would like to cap it to where it may only up the overall damage by +3
right now it just ups the first die of the weapon
so theoretically players could take a 1d37 weapon and even upping it by +1 would make it way too much
Code:
ACMD(do_forge) {     /* PLEASE NOTE!!!  This command alters the object_values of the target        weapon, and this will save to the rent files.            Mortals can only forge a weapon once so it uses GET_OBJ_FORGED            from one of the enchant slots in Utils.H to put a check on this.            Weapons can only be forged once.     */          struct obj_data *weapon = NULL;     struct obj_data *obj, *next_obj;     char weapon_name[MAX_STRING_LENGTH];         char buf[MAX_INPUT_LENGTH];     int found = FALSE, prob = 0, dam = 0;     one_argument(argument, weapon_name);     /*if ((GET_CLASS(ch) == CLASS_WARLOCK || GET_CLASS(ch) == CLASS_NECROMANCER) &&         GET_LEVEL(ch) < LVL_IMMORT) {                 send_to_char(ch, "You have no idea how to forge weapons!\r\n");                 return;         }*/         if (!can_see_room(ch, IN_ROOM(ch))) {                 send_to_char(ch, "It's too dark for you to forge!\r\n");                 return;         }         /* No forging while fighting */         if (IS_FIGHTING(ch)) {                 send_to_char(ch, "You are too busy fighting to forge right now!\r\n");                 return;         }     if (!*weapon_name) {         send_to_char(ch, "What do you wish to forge?\r\n");         return;     }     for (obj = ch->carrying; obj; obj = next_obj) {         next_obj = obj->next_content;         if (obj == NULL)             return;         else if (!(weapon = get_obj_in_list_vis(ch->carrying, ch, weapon_name)))             continue;         else             found = TRUE;     }          if (found == FALSE) {         sprintf(buf, "You don't have %s in your inventory!\r\n", weapon_name);         send_to_char(ch, buf);         return;     }     if (found && (GET_OBJ_TYPE(weapon) != ITEM_WEAPON)) {         sprintf(buf, "It doesn't look like %s would make a good weapon...\r\n", weapon_name);         send_to_char(ch, buf);         return;     }     if (GET_OBJ_FORGED(weapon) == 1) {         send_to_char(ch, "You cannot forge a weapon more than once!\r\n");         return;     }     if (GET_OBJ_EXTRA(weapon) == ITEM_MAGIC) {         send_to_char(ch, "The weapon is imbued with magical powers beyond your grasp.\r\nYou cannot further affect its form.\r\n");         return;     }         /* determine success probability */     prob += (GET_LEVEL(ch) << 1) + ((GET_TOT_DEX(ch) - 11) << 1);     prob += ((GET_TOT_STR(ch) - 11) << 1) + (100 >> 3);     if ((rand_number(10, 100) > prob) && (GET_LEVEL(ch) < LVL_IMMORT)) {         send_to_char(ch, "As you pound out the dents in the weapon, you hit a weak spot and it explodes!\r\n");         act("$n tries to forge a weapon, but it explodes!", FALSE, ch, 0,0, TO_ROOM);         extract_obj(weapon);         dam = rand_number(20, 60);         GET_HIT(ch) -= dam;         update_pos(ch);         return;     }     GET_OBJ_FORGED(weapon) += 1; //Prevents mortals from forging the same weapon more than once     GET_OBJ_VAL(weapon, 1) += (GET_LEVEL(ch) % 3) + rand_number(-1, 2); //Random Ave Dam upgrade or downgrade     GET_OBJ_RENT(weapon) += (GET_LEVEL(ch) << 3); //Adjusts Rent cost        /*Forge will cost a lot of resources*/         if (GET_WOOD(ch) > 0 && GET_STONE(ch) > 0) {                 GET_WOOD(ch) -= 500;                 GET_STONE(ch) -= 500;                 send_to_char(ch, "You have forged new life into the weapon!\r\n");                 act("$n vigorously pounds on a weapon!", FALSE, ch, 0, 0, TO_ROOM);         }         else {                send_to_char(ch, "You don't have enough resources to forge!\r\n");                 return;         } }

Please Log in or Create an account to join the conversation.

More
26 Sep 2022 21:03 #10167 by thomas
Replied by thomas on topic Forge too OP how to balance?
First off, I suggest you move the resource check higher:
Code:
one_argument(argument, weapon_name); +if (GET_WOOD(ch) < 500 || GET_STONE(ch) < 500) { + send_to_char(ch, "You don't have enough resources to forge!\r\n"); + return; +}
Next, about the forging. If you want to alter the damage by a max, add an affect instead of altering value 1. For instance by adding an affect to the object. Note, this is browser code, so you may need to tweak it a bit.
Code:
int i; ... for (i = 0; i < MAX_OBJECT_AFFECT; i++) { if (!weapon->affected[i].location || weapon->affected[i].location == APPLY_DAMROLL) break; } if (i == MAX_OBJECT_AFFECT) { // all slots filled. Must be an awesome weapon already... send_to_char(ch, "This weapon cannot be forged any more!\r\n"); return; } weapon->affected[i].location = APPLY_DAMROLL; weapon->affected[i].modifier += rand_number(2, GET_LEVEL(ch) / 10 + 2);
This adds between 2 and 5 damage to a weapon for a level 30, and just two for a level 9.

Please Log in or Create an account to join the conversation.

More
26 Sep 2022 22:07 #10169 by Nero
Replied by Nero on topic Forge too OP how to balance?
Thank you and I am just defining MAX_OBJECT_AFFECT in structs.h? And do I give it a value of 5 to make it the max or is there something else I need to add for it to work?

Please Log in or Create an account to join the conversation.

More
27 Sep 2022 00:48 #10170 by Nero
Replied by Nero on topic Forge too OP how to balance?
I got it working the way I want thanks!
I still added the 1 to the objval to only allow a weapon to be forged once
but it also looks at the max_affects which I have set to 10 (the allowable slots we have to add stats on a weapon)
that way if the weapon already has the max affects it cannot be forged to prevent it overriding a stat already there, or some other screw up.
Code:
    for (i = 0; i < MAX_OBJECT_AFFECT; i++) {         if (!weapon->affected[i].location || weapon->affected[i].location == APPLY_DAMROLL)         break;         }         if (i == MAX_OBJECT_AFFECT){         // all slots filled. Must be an awesome weapon already...         send_to_char(ch, "This weapon cannot be upgraded any more!\r\n");         return;        }        GET_OBJ_FORGED(weapon) += 1; //Prevents from forging the same weapon more than once        GET_OBJ_RENT(weapon) += (GET_LEVEL(ch) << 3); //Adjusts Rent cost        weapon->affected[i].location = APPLY_DAMROLL;        weapon->affected[i].modifier += rand_number(1, 3);        /*Forge will cost a lot of resources*/         if (GET_WOOD(ch) > 0 && GET_STONE(ch) > 0) {                 GET_WOOD(ch) -= 500;                 GET_STONE(ch) -= 500;                 send_to_char(ch, "You have forged new life into the weapon!\r\n");                 act("$n vigorously pounds on a weapon!", FALSE, ch, 0, 0, TO_ROOM);         }

Please Log in or Create an account to join the conversation.

More
27 Sep 2022 06:06 #10172 by thomas
Replied by thomas on topic Forge too OP how to balance?
What happens if you have 200 wood and 200 stone?

Please Log in or Create an account to join the conversation.

More
27 Sep 2022 06:40 - 27 Sep 2022 06:41 #10173 by Nero
Replied by Nero on topic Forge too OP how to balance?
I added the check to the top:

if (GET_WOOD(ch) < 500 || GET_STONE(ch) < 500) {
send_to_char(ch, "You don't have enough resources to forge!\r\n");
return;
}

So I suppose with that being said, I can remove the check at the bottom
Last edit: 27 Sep 2022 06:41 by Nero.

Please Log in or Create an account to join the conversation.

Time to create page: 0.218 seconds