1 | /* |
1 | /* |
2 | * CrossFire, A Multiplayer game for X-windows |
2 | * CrossFire, A Multiplayer game |
3 | * |
3 | * |
4 | * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team |
4 | * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team |
5 | * Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
5 | * Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
6 | * Copyright (C) 1992 Frank Tore Johansen |
6 | * Copyright (C) 1992 Frank Tore Johansen |
7 | * |
7 | * |
… | |
… | |
484 | * just create one object, do all the processing, and then determine |
484 | * just create one object, do all the processing, and then determine |
485 | * if that one object should be inserted or if we need to make copies. |
485 | * if that one object should be inserted or if we need to make copies. |
486 | */ |
486 | */ |
487 | tmp = arch_to_object (at); |
487 | tmp = arch_to_object (at); |
488 | |
488 | |
489 | if (settings.real_wiz == FALSE) |
|
|
490 | SET_FLAG (tmp, FLAG_WAS_WIZ); |
|
|
491 | |
|
|
492 | if (set_magic) |
489 | if (set_magic) |
493 | set_abs_magic (tmp, magic); |
490 | set_abs_magic (tmp, magic); |
494 | |
491 | |
495 | if (art) |
492 | if (art) |
496 | give_artifact_abilities (tmp, art->item); |
493 | give_artifact_abilities (tmp, art->item); |
… | |
… | |
620 | { |
617 | { |
621 | head = dup; |
618 | head = dup; |
622 | tmp->copy_to (dup); |
619 | tmp->copy_to (dup); |
623 | } |
620 | } |
624 | |
621 | |
625 | if (settings.real_wiz == FALSE) |
|
|
626 | SET_FLAG (dup, FLAG_WAS_WIZ); |
|
|
627 | |
|
|
628 | dup->x = op->x + dup->arch->clone.x; |
622 | dup->x = op->x + dup->arch->clone.x; |
629 | dup->y = op->y + dup->arch->clone.y; |
623 | dup->y = op->y + dup->arch->clone.y; |
630 | dup->map = op->map; |
624 | dup->map = op->map; |
631 | |
625 | |
632 | if (head != dup) |
626 | if (head != dup) |
… | |
… | |
771 | return 1; |
765 | return 1; |
772 | } |
766 | } |
773 | |
767 | |
774 | if ((arg2 = strchr (arg, ' '))) |
768 | if ((arg2 = strchr (arg, ' '))) |
775 | arg2++; |
769 | arg2++; |
776 | if (settings.real_wiz == FALSE) |
770 | |
777 | SET_FLAG (tmp, FLAG_WAS_WIZ); /* To avoid cheating */ |
|
|
778 | if (set_variable (tmp, arg) == -1) |
771 | if (set_variable (tmp, arg) == -1) |
779 | new_draw_info_format (NDI_UNIQUE, 0, op, "Unknown variable %s", arg); |
772 | new_draw_info_format (NDI_UNIQUE, 0, op, "Unknown variable %s", arg); |
780 | else |
773 | else |
781 | { |
|
|
782 | new_draw_info_format (NDI_UNIQUE, 0, op, "(%s#%d)->%s=%s", &tmp->name, tmp->count, arg, arg2); |
774 | new_draw_info_format (NDI_UNIQUE, 0, op, "(%s#%d)->%s=%s", &tmp->name, tmp->count, arg, arg2); |
783 | } |
|
|
784 | |
775 | |
785 | return 1; |
776 | return 1; |
786 | } |
777 | } |
787 | |
778 | |
788 | int |
779 | int |
… | |
… | |
882 | } |
873 | } |
883 | |
874 | |
884 | pl->ob->stats.exp += i; |
875 | pl->ob->stats.exp += i; |
885 | calc_perm_exp (pl->ob); |
876 | calc_perm_exp (pl->ob); |
886 | player_lvl_adj (pl->ob, NULL); |
877 | player_lvl_adj (pl->ob, NULL); |
887 | |
|
|
888 | if (settings.real_wiz == FALSE) |
|
|
889 | SET_FLAG (pl->ob, FLAG_WAS_WIZ); |
|
|
890 | |
878 | |
891 | return 1; |
879 | return 1; |
892 | } |
880 | } |
893 | |
881 | |
894 | new_draw_info (NDI_UNIQUE, 0, op, "No such player."); |
882 | new_draw_info (NDI_UNIQUE, 0, op, "No such player."); |
… | |
… | |
970 | |
958 | |
971 | for_all_players (pl) |
959 | for_all_players (pl) |
972 | { |
960 | { |
973 | if (!strcmp (pl->ob->name, thing)) |
961 | if (!strcmp (pl->ob->name, thing)) |
974 | { |
962 | { |
975 | if (settings.real_wiz == FALSE) |
|
|
976 | SET_FLAG (pl->ob, FLAG_WAS_WIZ); |
|
|
977 | if (!strcmp ("str", thing2)) |
|
|
978 | pl->ob->stats.Str = iii, pl->orig_stats.Str = iii; |
963 | if (!strcmp ("str", thing2)) pl->ob->stats.Str = iii, pl->orig_stats.Str = iii; |
979 | if (!strcmp ("dex", thing2)) |
|
|
980 | pl->ob->stats.Dex = iii, pl->orig_stats.Dex = iii; |
964 | if (!strcmp ("dex", thing2)) pl->ob->stats.Dex = iii, pl->orig_stats.Dex = iii; |
981 | if (!strcmp ("con", thing2)) |
|
|
982 | pl->ob->stats.Con = iii, pl->orig_stats.Con = iii; |
965 | if (!strcmp ("con", thing2)) pl->ob->stats.Con = iii, pl->orig_stats.Con = iii; |
983 | if (!strcmp ("wis", thing2)) |
|
|
984 | pl->ob->stats.Wis = iii, pl->orig_stats.Wis = iii; |
966 | if (!strcmp ("wis", thing2)) pl->ob->stats.Wis = iii, pl->orig_stats.Wis = iii; |
985 | if (!strcmp ("cha", thing2)) |
|
|
986 | pl->ob->stats.Cha = iii, pl->orig_stats.Cha = iii; |
967 | if (!strcmp ("cha", thing2)) pl->ob->stats.Cha = iii, pl->orig_stats.Cha = iii; |
987 | if (!strcmp ("int", thing2)) |
|
|
988 | pl->ob->stats.Int = iii, pl->orig_stats.Int = iii; |
968 | if (!strcmp ("int", thing2)) pl->ob->stats.Int = iii, pl->orig_stats.Int = iii; |
989 | if (!strcmp ("pow", thing2)) |
|
|
990 | pl->ob->stats.Pow = iii, pl->orig_stats.Pow = iii; |
969 | if (!strcmp ("pow", thing2)) pl->ob->stats.Pow = iii, pl->orig_stats.Pow = iii; |
|
|
970 | |
991 | sprintf (buf, "%s has been altered.", &pl->ob->name); |
971 | sprintf (buf, "%s has been altered.", &pl->ob->name); |
992 | new_draw_info (NDI_UNIQUE, 0, op, buf); |
972 | new_draw_info (NDI_UNIQUE, 0, op, buf); |
993 | pl->ob->update_stats (); |
973 | pl->ob->update_stats (); |
994 | return 1; |
974 | return 1; |
995 | } |
975 | } |
… | |
… | |
1004 | { /* 'nodm' is alias */ |
984 | { /* 'nodm' is alias */ |
1005 | CLEAR_FLAG (op, FLAG_WIZ); |
985 | CLEAR_FLAG (op, FLAG_WIZ); |
1006 | CLEAR_FLAG (op, FLAG_WIZPASS); |
986 | CLEAR_FLAG (op, FLAG_WIZPASS); |
1007 | CLEAR_FLAG (op, FLAG_WIZCAST); |
987 | CLEAR_FLAG (op, FLAG_WIZCAST); |
1008 | |
988 | |
1009 | if (settings.real_wiz == TRUE) |
|
|
1010 | CLEAR_FLAG (op, FLAG_WAS_WIZ); |
|
|
1011 | if (op->contr->hidden) |
989 | if (op->contr->hidden) |
1012 | { |
990 | { |
1013 | new_draw_info (NDI_UNIQUE, 0, op, "You are no longer hidden from other players"); |
991 | new_draw_info (NDI_UNIQUE, 0, op, "You are no longer hidden from other players"); |
1014 | op->map->players++; |
992 | op->map->players++; |
1015 | new_draw_info_format (NDI_UNIQUE | NDI_ALL | NDI_DK_ORANGE, 5, NULL, "%s has entered the game.", &op->name); |
993 | new_draw_info_format (NDI_UNIQUE | NDI_ALL | NDI_DK_ORANGE, 5, NULL, "%s has entered the game.", &op->name); |
… | |
… | |
1077 | } |
1055 | } |
1078 | |
1056 | |
1079 | if (checkdm (op, op->name, (params ? params : "*"), op->contr->ns->host)) |
1057 | if (checkdm (op, op->name, (params ? params : "*"), op->contr->ns->host)) |
1080 | { |
1058 | { |
1081 | SET_FLAG (op, FLAG_WIZ); |
1059 | SET_FLAG (op, FLAG_WIZ); |
1082 | SET_FLAG (op, FLAG_WAS_WIZ); |
|
|
1083 | SET_FLAG (op, FLAG_WIZPASS); |
1060 | SET_FLAG (op, FLAG_WIZPASS); |
1084 | SET_FLAG (op, FLAG_WIZCAST); |
1061 | SET_FLAG (op, FLAG_WIZCAST); |
|
|
1062 | |
1085 | new_draw_info (NDI_UNIQUE, 0, op, "Ok, you are the Dungeon Master!"); |
1063 | new_draw_info (NDI_UNIQUE, 0, op, "Ok, you are the Dungeon Master!"); |
1086 | /* |
1064 | /* |
1087 | * Remove setting flying here - that won't work, because next |
1065 | * Remove setting flying here - that won't work, because next |
1088 | * fix_player() is called that will get cleared - proper solution |
1066 | * fix_player() is called that will get cleared - proper solution |
1089 | * is probably something like a wiz_force which gives that and any |
1067 | * is probably something like a wiz_force which gives that and any |