Skip to content

Commit

Permalink
Ground Control to Major Tom (#723)
Browse files Browse the repository at this point in the history
* Update fight.cpp

* Update act.offensive.cpp

* Update newmatrix.hpp

* Update utils.cpp

* Update awake.hpp

* Update act.obj.cpp

* Update act.drive.cpp

* Update constants.cpp

* Update zoomies.cpp

* Update zoomies.cpp

* Update handler.cpp

* Update zoomies.cpp

* Update handler.cpp

* Update zoomies.cpp
  • Loading branch information
TheVilest authored Dec 7, 2023
1 parent 24419c5 commit b399325
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 8 deletions.
5 changes: 4 additions & 1 deletion src/act.drive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,9 @@ ACMD(do_upgrade)
case TYPE_POKEYSTICK:
target = 3;
break;
case TYPE_AUTOPILOT:
target = 8 - veh->handling;
break;
default:
target = 4;
break;
Expand Down Expand Up @@ -2544,4 +2547,4 @@ int get_vehicle_modifier(struct veh_data *veh, bool include_weather)
if (include_weather && weather_info.sky >= SKY_RAINING)
mod++;
return mod;
}
}
5 changes: 4 additions & 1 deletion src/act.obj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1684,6 +1684,9 @@ ACMD(do_get)
case TYPE_POKEYSTICK:
target = 3;
break;
case TYPE_AUTOPILOT:
target = 8 - veh->handling;
break;
default:
target = 4;
break;
Expand Down Expand Up @@ -4862,4 +4865,4 @@ ACMD(do_conceal_reveal) {
send_to_char("You rearrange your equipment.\r\n", ch);
act("$n rearranges $s equipment.", TRUE, ch, 0, 0, TO_ROOM);
playerDB.SaveChar(ch);
}
}
3 changes: 2 additions & 1 deletion src/awake.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1924,7 +1924,8 @@ enum {
#define TYPE_MISC 21
#define TYPE_AMMOBIN 22
#define TYPE_POKEYSTICK 23
#define NUM_MODTYPES 24
#define TYPE_AUTOPILOT 24
#define NUM_MODTYPES 25

#define ENGINE_NONE 0
#define ENGINE_ELECTRIC 1
Expand Down
3 changes: 2 additions & 1 deletion src/constants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1851,7 +1851,8 @@ struct mod_data mod_types[NUM_MODTYPES] =
{ "Tires", TYPE_KIT },
{ "Other", TYPE_KIT },
{ "Ammo Bin", TYPE_KIT },
{ "Pokeystick", TYPE_WORKSHOP }
{ "Pokeystick", TYPE_WORKSHOP },
{ "Autopilot", TYPE_WORKSHOP }

};
const char *mod_name[NUM_MODS] =
Expand Down
2 changes: 1 addition & 1 deletion src/handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ void affect_veh(struct veh_data *veh, byte loc, sbyte mod)
veh->load += mod;
break;
case VAFF_PILOT:
veh->pilot = mod;
veh->pilot += mod;
break;
case VAFF_ULTRASONIC:
if (mod > 0)
Expand Down
7 changes: 4 additions & 3 deletions src/zoomies.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ int flight_test(struct char_data *ch, struct veh_data *veh) {

int skill_num = get_pilot_skill_for_veh(veh);
int tn = veh->handling + get_vehicle_modifier(veh, FALSE);
int get_autopilot = veh->pilot;

snprintf(rbuf, sizeof(rbuf), "Flight test modifiers for %s (base %d from handling): ", GET_CHAR_NAME(ch), tn);

Expand All @@ -464,8 +465,8 @@ int flight_test(struct char_data *ch, struct veh_data *veh) {
}

int dice = get_skill(ch, skill_num, tn, rbuf, sizeof(rbuf));
int successes = success_test(dice, tn, ch, "flight-test");
snprintf(ENDOF(rbuf), sizeof(rbuf) - strlen(rbuf), ". Dice %d, TN %d: %d success%s.", dice, tn, successes, successes == 1 ? "" : "es");
int successes = success_test(dice + get_autopilot, tn, ch, "flight-test");
snprintf(ENDOF(rbuf), sizeof(rbuf) - strlen(rbuf), ". Skill %d, Autopilot Rating %d, TN %d: %d success%s.", dice, get_autopilot, tn, successes, successes == 1 ? "" : "es");

act(rbuf, TRUE, ch, 0, 0, TO_ROLLS);

Expand Down Expand Up @@ -711,4 +712,4 @@ bool veh_is_currently_flying(struct veh_data *veh) {
void clear_veh_flight_info(struct veh_data *veh) {
veh->flight_duration = 0;
veh->flight_target = NULL;
}
}

0 comments on commit b399325

Please sign in to comment.