• R/O
  • SSH
  • HTTPS

angband65: Commit


Commit MetaInfo

Revision152 (tree)
Zeit2009-05-17 05:14:03
Autorpaulblay

Log Message

This brings /65 up to date with Vanilla Changeset 1401 (note that this includes Changeset 1379 that was earlier excluded due to a bug).

Ändern Zusammenfassung

Diff

--- trunk/Angband65/src/birth.c (revision 151)
+++ trunk/Angband65/src/birth.c (revision 152)
@@ -830,7 +830,7 @@
830830 break;
831831 }
832832
833- /* If possible buy adj DEX of 18/10 */
833+ /* Try and buy adj DEX of 18/10 */
834834 case 1:
835835 {
836836 if (!maxed[A_DEX] && p_ptr->state.stat_top[A_DEX] < 18+10)
@@ -846,12 +846,26 @@
846846 break;
847847 }
848848
849+ /* If we can't get 18/10 dex, sell it back. */
850+ case 2:
851+ {
852+ if (p_ptr->state.stat_top[A_DEX] < 18+10)
853+ {
854+ while (stats[A_DEX] > 10)
855+ sell_stat(A_DEX, stats, points_spent, points_left);
856+
857+ maxed[A_DEX] = FALSE;
858+ }
859+
860+ step++;
861+ }
862+
849863 /*
850864 * Spend up to half remaining points on each of spell-stat and
851865 * con, but only up to max base of 16 unless a pure class
852866 * [mage or priest or warrior]
853867 */
854- case 2:
868+ case 3:
855869 {
856870 int points_trigger = *points_left / 2;
857871
@@ -900,7 +914,7 @@
900914 * If there are any points left, spend as much as possible in
901915 * order on DEX, non-spell-stat, CHR.
902916 */
903- case 3:
917+ case 4:
904918 {
905919 int next_stat;
906920
@@ -1000,8 +1014,8 @@
10001014
10011015 generate_player();
10021016
1003- /* Update stats with bonuses, etc. */
1004-/* get_bonuses(); */ /* TODO This change (Changeset 140) caused game crash */
1017+ /* Update stats with bonuses, etc. */
1018+ get_bonuses();
10051019 }
10061020
10071021 /*
@@ -1036,16 +1050,27 @@
10361050 */
10371051 birther quickstart_prev = {0, 0, 0, 0, 0, 0, 0, 0, {0}, "" };
10381052
1039- /* If there's a quickstart character, store it for later use. */
1053+ /*
1054+ * If there's a quickstart character, store it for later use.
1055+ * If not, default to whatever the first of the choices is.
1056+ */
10401057 if (quickstart_allowed)
1058+ {
10411059 save_roller_data(&quickstart_prev);
1060+ }
1061+ else
1062+ {
1063+ p_ptr->psex = 0;
1064+ p_ptr->pclass = 0;
1065+ p_ptr->prace = 0;
1066+ generate_player();
1067+ }
10421068
1043- do_birth_reset(quickstart_allowed, &quickstart_prev);
10441069 reset_stats(stats, points_spent, &points_left);
1045-/* do_birth_reset(quickstart_allowed, &quickstart_prev); */ /* TODO This change (Changeset 140) caused gamecrash */
1070+ do_birth_reset(quickstart_allowed, &quickstart_prev);
10461071
10471072 /* We're ready to start the interactive birth process. */
1048- event_signal(EVENT_ENTER_BIRTH);
1073+ event_signal_flag(EVENT_ENTER_BIRTH, quickstart_allowed);
10491074
10501075 /*
10511076 * Loop around until the UI tells us we have an acceptable character.
@@ -1059,10 +1084,8 @@
10591084
10601085 if (cmd.command == CMD_BIRTH_RESET)
10611086 {
1087+ reset_stats(stats, points_spent, &points_left);
10621088 do_birth_reset(quickstart_allowed, &quickstart_prev);
1063- generate_player();
1064- reset_stats(stats, points_spent, &points_left);
1065-/* do_birth_reset(quickstart_allowed, &quickstart_prev); */ /* Changeset 140 */
10661089 rolled_stats = FALSE;
10671090 }
10681091 else if (cmd.command == CMD_CHOOSE_SEX)
--- trunk/Angband65/src/ui-birth.c (revision 151)
+++ trunk/Angband65/src/ui-birth.c (revision 152)
@@ -77,6 +77,7 @@
7777
7878
7979 static void point_based_start(void);
80+static bool quickstart_allowed = FALSE;
8081
8182 /* ------------------------------------------------------------------------
8283 * Quickstart? screen.
@@ -848,7 +849,12 @@
848849 {
849850 cmd_insert(CMD_BIRTH_RESET);
850851 roller = BIRTH_METHOD_CHOICE;
851- next = quickstart_question();
852+
853+ if (quickstart_allowed)
854+ next = quickstart_question();
855+ else
856+ next = BIRTH_SEX_CHOICE;
857+
852858 break;
853859 }
854860
@@ -965,6 +971,10 @@
965971 UNREFERENCED_PARAMETER(user);
966972 UNREFERENCED_PARAMETER(data);
967973 UNREFERENCED_PARAMETER(type);
974+
975+ /* Set the ugly static global that tells us if quickstart's available. */
976+ quickstart_allowed = data->flag;
977+
968978 setup_menus();
969979 }
970980
--- trunk/Angband65/src/game-event.c (revision 151)
+++ trunk/Angband65/src/game-event.c (revision 152)
@@ -114,7 +114,15 @@
114114 game_event_dispatch(type, NULL);
115115 }
116116
117+void event_signal_flag(game_event_type type, bool flag)
118+{
119+ game_event_data data;
120+ data.flag = flag;
117121
122+ game_event_dispatch(type, &data);
123+}
124+
125+
118126 void event_signal_point(game_event_type type, int x, int y)
119127 {
120128 game_event_data data;
--- trunk/Angband65/src/game-event.h (revision 151)
+++ trunk/Angband65/src/game-event.h (revision 152)
@@ -67,6 +67,8 @@
6767
6868 const char *string;
6969
70+ bool flag;
71+
7072 struct
7173 {
7274 bool reset;
@@ -105,6 +107,7 @@
105107
106108 void event_signal_point(game_event_type, int x, int y);
107109 void event_signal_string(game_event_type, const char *s);
110+void event_signal_flag(game_event_type type, bool flag);
108111 void event_signal(game_event_type);
109112
110113 #endif /* INCLUDED_GAME_EVENT_H */
Show on old repository browser