… | |
… | |
189 | $MESSAGE_WINDOW->show; |
189 | $MESSAGE_WINDOW->show; |
190 | |
190 | |
191 | unshift @dialog, new CFClient::UI::Label |
191 | unshift @dialog, new CFClient::UI::Label |
192 | max_w => $::WIDTH * 0.4, |
192 | max_w => $::WIDTH * 0.4, |
193 | ellipsise => 0, |
193 | ellipsise => 0, |
194 | markup => "\nOr use your keyboard:\n"; |
194 | markup => "\nOr use your keyboard and the text entry below:\n"; |
195 | |
195 | |
196 | unshift @dialog, my $table = new CFClient::UI::Table; |
196 | unshift @dialog, my $table = new CFClient::UI::Table; |
197 | |
197 | |
198 | $table->add (0, 0, new CFClient::UI::Button |
198 | $table->add (0, 0, new CFClient::UI::Button |
199 | text => "Next Race", |
199 | text => "Next Race", |
… | |
… | |
216 | max_w => $::WIDTH * 0.4, |
216 | max_w => $::WIDTH * 0.4, |
217 | ellipsise => 0, |
217 | ellipsise => 0, |
218 | markup => |
218 | markup => |
219 | "<big><b>Character Creation: Race</b></big>\n\n" |
219 | "<big><b>Character Creation: Race</b></big>\n\n" |
220 | . "Look at the <b>Messages</b> window to see a description of this race " |
220 | . "Look at the <b>Messages</b> window to see a description of this race " |
221 | . "(<small>or hover with your mouse over the bottommost entry in the status area in the lower left area of the screen</small>) " |
|
|
222 | . "and the center of the screen to see how this race looks like " |
221 | . "and the center of the screen to see how this race looks like " |
223 | . "(<small>this is below this dialog window, you may need to click on the display area to make it visible</small>).\n\n" |
222 | . "(<small>below this dialog window: you may need to move the dialog away and " |
|
|
223 | . "click into the display area to make it visible</small>).\n\n" |
224 | . "You can look at another race, or accept this race (you will come back to this race eventually, " |
224 | . "You can look at another race, or accept this race (you will cycle back to " |
225 | . "so you can take your time making this important choice." |
225 | . "this race eventually, so you can take your time making this important choice." |
226 | ; |
226 | ; |
227 | |
227 | |
228 | } elsif ($prompt =~ /roll new stats/) { |
228 | } elsif ($prompt =~ /roll new stats/) { |
229 | if (my $stat = delete $conn->{stat_change_with}) { |
229 | if (my $stat = delete $conn->{stat_change_with}) { |
230 | $conn->send ("reply $stat"); |
230 | $conn->send ("reply $stat"); |
… | |
… | |
236 | $MESSAGE_WINDOW->hide; |
236 | $MESSAGE_WINDOW->hide; |
237 | |
237 | |
238 | unshift @dialog, new CFClient::UI::Label |
238 | unshift @dialog, new CFClient::UI::Label |
239 | max_w => $::WIDTH * 0.4, |
239 | max_w => $::WIDTH * 0.4, |
240 | ellipsise => 0, |
240 | ellipsise => 0, |
241 | markup => "\nOr use your keyboard:\n"; |
241 | markup => "\nOr use your keyboard and the text entry below:\n"; |
242 | |
242 | |
243 | unshift @dialog, my $table = new CFClient::UI::Table; |
243 | unshift @dialog, my $table = new CFClient::UI::Table; |
244 | |
244 | |
245 | # left: re-roll |
245 | # left: re-roll |
246 | $table->add (0, 0, new CFClient::UI::Button |
246 | $table->add (0, 0, new CFClient::UI::Button |
… | |
… | |
252 | }, |
252 | }, |
253 | ); |
253 | ); |
254 | |
254 | |
255 | # center: swap stats |
255 | # center: swap stats |
256 | my ($sw1, $sw2) = map +(new CFClient::UI::Combobox |
256 | my ($sw1, $sw2) = map +(new CFClient::UI::Combobox |
|
|
257 | expand => 1, |
257 | value => $_, |
258 | value => $_, |
258 | options => [ |
259 | options => [ |
259 | [1 => "Str", "Strength ($conn->{stat}{+CS_STAT_STR})"], |
260 | [1 => "Str", "Strength ($conn->{stat}{+CS_STAT_STR})"], |
260 | [2 => "Dex", "Dexterity ($conn->{stat}{+CS_STAT_DEX})"], |
261 | [2 => "Dex", "Dexterity ($conn->{stat}{+CS_STAT_DEX})"], |
261 | [3 => "Con", "Constitution ($conn->{stat}{+CS_STAT_CON})"], |
262 | [3 => "Con", "Constitution ($conn->{stat}{+CS_STAT_CON})"], |
… | |
… | |
286 | destroy_query_dialog $conn; |
287 | destroy_query_dialog $conn; |
287 | 0 |
288 | 0 |
288 | }, |
289 | }, |
289 | ); |
290 | ); |
290 | |
291 | |
|
|
292 | unshift @dialog, my $hbox = new CFClient::UI::HBox; |
|
|
293 | for ( |
|
|
294 | [Str => CS_STAT_STR], |
|
|
295 | [Dex => CS_STAT_DEX], |
|
|
296 | [Con => CS_STAT_CON], |
|
|
297 | [Int => CS_STAT_INT], |
|
|
298 | [Wis => CS_STAT_WIS], |
|
|
299 | [Pow => CS_STAT_POW], |
|
|
300 | [Cha => CS_STAT_CHA], |
|
|
301 | ) { |
|
|
302 | my ($name, $id) = @$_; |
|
|
303 | $hbox->add (new CFClient::UI::Label |
|
|
304 | markup => "$conn->{stat}{$id} <span foreground='yellow'>$name</span>", |
|
|
305 | align => 0, |
|
|
306 | expand => 1, |
|
|
307 | can_events => 1, |
|
|
308 | can_hover => 1, |
|
|
309 | tooltip => $CFClient::STAT_TOOLTIP{$name}, |
|
|
310 | ); |
|
|
311 | } |
|
|
312 | |
291 | unshift @dialog, new CFClient::UI::Label |
313 | unshift @dialog, new CFClient::UI::Label |
292 | max_w => $::WIDTH * 0.4, |
314 | max_w => $::WIDTH * 0.4, |
293 | ellipsise => 0, |
315 | ellipsise => 0, |
294 | markup => |
316 | markup => |
295 | "<big><b>Character Creation: Stats</b></big>\n\n" |
317 | "<big><b>Character Creation: Stats</b></big>\n\n" |
296 | . "Look at the <b>Stats</b> window to see your basic stats " |
318 | . "<b>Stats</b> are a very important aspect of your character. You can use the tooltips to learn what each Stat governs.\n\n" |
297 | . "(first column: 1 strength, 2 dexterity, 3 constitution, 4 intelligence, 5 wisdom, 6 power and 7 charisma).\n\n" |
319 | . "The stats generated by the server are always sorted from Str (highest) to Cha (lowest). " |
|
|
320 | . "They will be modified later by both the race and the class you choose.\n\n" |
298 | . "You can create another set of stats, swap two stat values with each other or accept the stats as they are now and continue. " |
321 | . "You can create another set of stats, swap two stat values with each other or accept the stats as shown below and continue.\n" |
299 | . "Race selection will influence those values later on." |
|
|
300 | ; |
322 | ; |
301 | } |
323 | } |
302 | |
324 | |
303 | push @dialog, my $entry = new CFClient::UI::Entry |
325 | push @dialog, my $entry = new CFClient::UI::Entry |
304 | on_changed => sub { |
326 | on_changed => sub { |
… | |
… | |
644 | |
666 | |
645 | $table |
667 | $table |
646 | } |
668 | } |
647 | |
669 | |
648 | sub stats_window { |
670 | sub stats_window { |
649 | my $r = |
|
|
650 | new CFClient::UI::ScrolledWindow ( |
671 | my $r = new CFClient::UI::ScrolledWindow ( |
651 | expand => 1, |
672 | expand => 1, |
652 | scroll_y => 1 |
673 | scroll_y => 1 |
653 | ); |
674 | ); |
654 | $r->add (my $vb = new CFClient::UI::VBox); |
675 | $r->add (my $vb = new CFClient::UI::VBox); |
655 | |
676 | |
656 | $vb->add ($STATWIDS->{title} = new CFClient::UI::Label valign => 0, align => -1, text => "Title:", expand => 1, |
677 | $vb->add ($STATWIDS->{title} = new CFClient::UI::Label valign => 0, align => -1, text => "Title:", expand => 1, |
657 | can_hover => 1, can_events => 1, |
678 | can_hover => 1, can_events => 1, |
658 | tooltip => "Your name and title. You can change your title by using the <b>title</b> command, if supported by the server."); |
679 | tooltip => "Your name and title. You can change your title by using the <b>title</b> command, if supported by the server."); |
… | |
… | |
673 | $hb->add (my $tbl = new CFClient::UI::Table expand => 1); |
694 | $hb->add (my $tbl = new CFClient::UI::Table expand => 1); |
674 | |
695 | |
675 | my $color2 = [1, 1, 0]; |
696 | my $color2 = [1, 1, 0]; |
676 | |
697 | |
677 | for ( |
698 | for ( |
678 | [0, 0, st_str => "Str", 30, "<b>Physical Strength</b>, determines damage dealt with weapons, how much you can carry, and how often you can attack"], |
699 | [0, 0, st_str => "Str", 30], |
679 | [0, 1, st_dex => "Dex", 30, "<b>Dexterity</b>, your physical agility. Determines chance of being hit and affects armor class and speed"], |
700 | [0, 1, st_dex => "Dex", 30], |
680 | [0, 2, st_con => "Con", 30, "<b>Constitution</b>, physical health and toughness. Determines how many healthpoints you can have"], |
701 | [0, 2, st_con => "Con", 30], |
681 | [0, 3, st_int => "Int", 30, "<b>Intelligence</b>, your ability to learn and use skills and incantations (both prayers and magic) and determines how much spell points you can have"], |
702 | [0, 3, st_int => "Int", 30], |
682 | [0, 4, st_wis => "Wis", 30, "<b>Wisdom</b>, the ability to learn and use divine magic (prayers). Determines how many grace points you can have"], |
703 | [0, 4, st_wis => "Wis", 30], |
683 | [0, 5, st_pow => "Pow", 30, "<b>Power</b>, your magical potential. Influences the strength of spell effects, and also how much your spell and grace points increase when leveling up"], |
704 | [0, 5, st_pow => "Pow", 30], |
684 | [0, 6, st_cha => "Cha", 30, "<b>Charisma</b>, how well you are received by NPCs. Affects buying and selling prices in shops."], |
705 | [0, 6, st_cha => "Cha", 30], |
685 | |
706 | |
686 | [2, 0, st_wc => "Wc", -120, "<b>Weapon Class</b>, effectiveness of melee/missile attacks. Lower is more potent. Current weapon, level and Str are some things which effect the value of Wc. The value of Wc may range between 25 and -72."], |
707 | [2, 0, st_wc => "Wc", -120], |
687 | [2, 1, st_ac => "Ac", -120, "<b>Armour Class</b>, how protected you are from being hit by any attack. Lower values are better. Ac is based on your race and is modified by the Dex and current armour worn. For characters that cannot wear armour, Ac improves as their level increases."], |
708 | [2, 1, st_ac => "Ac", -120], |
688 | [2, 2, st_dam => "Dam", 120, "<b>Damage</b>, how much damage your melee/missile attack inflicts. Higher values indicate a greater amount of damage will be inflicted with each attack."], |
709 | [2, 2, st_dam => "Dam", 120], |
689 | [2, 3, st_arm => "Arm", 120, "<b>Armour</b>, how much damage (from physical attacks) will be subtracted from successful hits made upon you. This value ranges between 0 to 99%. Current armour worn primarily determines Arm value. This is the same as the physical resistance."], |
710 | [2, 3, st_arm => "Arm", 120], |
690 | [2, 4, st_spd => "Spd", 10.54, "<b>Speed</b>, how fast you can move. The value of speed may range between nearly 0 (\"very slow\") to higher than 5 (\"lightning fast\"). Base speed is determined from the Dex and modified downward proportionally by the amount of weight carried which exceeds the Max Carry limit. The armour worn also sets the upper limit on speed."], |
711 | [2, 4, st_spd => "Spd", 10.54], |
691 | [2, 5, st_wspd => "WSp", 10.54, "<b>Weapon Speed</b>, how many attacks you may make per unit of time (0.120s). Higher values indicate faster attack speed. Current weapon and Dex effect the value of weapon speed."], |
712 | [2, 5, st_wspd => "WSp", 10.54], |
692 | ) { |
713 | ) { |
693 | my ($col, $row, $id, $label, $template, $tooltip) = @$_; |
714 | my ($col, $row, $id, $label, $template) = @$_; |
694 | |
715 | |
695 | $tbl->add ($col , $row, $STATWIDS->{$id} = new CFClient::UI::Label |
716 | $tbl->add ($col , $row, $STATWIDS->{$id} = new CFClient::UI::Label |
696 | font => $FONT_FIXED, can_hover => 1, can_events => 1, valign => 0, align => +1, template => $template, tooltip => $tooltip); |
717 | font => $FONT_FIXED, can_hover => 1, can_events => 1, valign => 0, |
|
|
718 | align => +1, template => $template, tooltip => $CFClient::STAT_TOOLTIP{$label}); |
697 | $tbl->add ($col + 1, $row, $STATWIDS->{"$id\_lbl"} = new CFClient::UI::Label |
719 | $tbl->add ($col + 1, $row, $STATWIDS->{"$id\_lbl"} = new CFClient::UI::Label |
698 | font => $FONT_FIXED, can_hover => 1, can_events => 1, fg => $color2, valign => 0, align => -1, text => $label, tooltip => $tooltip); |
720 | font => $FONT_FIXED, can_hover => 1, can_events => 1, fg => $color2, valign => 0, |
|
|
721 | align => -1, text => $label, tooltip => $CFClient::STAT_TOOLTIP{$label}); |
699 | } |
722 | } |
700 | |
723 | |
701 | $vb->add (my $tbl2 = new CFClient::UI::Table expand => 1); |
724 | $vb->add (my $tbl2 = new CFClient::UI::Table expand => 1); |
702 | |
725 | |
703 | my $row = 0; |
726 | my $row = 0; |