MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame^] | 1 | // Autor: Rumata@gmx.de |
| 2 | // ... sozusagen meine private rasse ... |
| 3 | // |
| 4 | // MorgenGrauen MUDlib |
| 5 | // |
| 6 | // shells/magier.c -- magier shell |
| 7 | // |
| 8 | // $Id: baum.c 8675 2014-02-18 20:39:54Z Zesstra $ |
| 9 | |
| 10 | #pragma strong_types,save_types |
| 11 | |
| 12 | inherit "/std/shells/magier"; |
| 13 | |
| 14 | //#define NEED_PROTOTYPES |
| 15 | |
| 16 | #include <thing/properties.h> |
| 17 | #include <properties.h> |
| 18 | #include <wizlevels.h> |
| 19 | #include <language.h> |
| 20 | #include <moving.h> |
| 21 | #include <attributes.h> |
| 22 | #include <combat.h> |
| 23 | #include <defines.h> |
| 24 | #include <ansi.h> |
| 25 | #include <udp.h> |
| 26 | #include <new_skills.h> |
| 27 | |
| 28 | static int _wurzel; |
| 29 | |
| 30 | void create() |
| 31 | { |
| 32 | if (!clonep() || object_name(this_object()) == __FILE__[0..<3]) { |
| 33 | set_next_reset(-1); |
| 34 | return; |
| 35 | } |
| 36 | |
| 37 | ::create(); |
| 38 | _wurzel = -1; |
| 39 | } |
| 40 | |
| 41 | static int wurzel_an( string arg ) { |
| 42 | string num; |
| 43 | int count; |
| 44 | |
| 45 | if( this_object() != this_interactive() ) return 0; |
| 46 | notify_fail( "WAS willst Du schlagen?\n" ); |
| 47 | if( !arg || sscanf( arg, "wurzel%s", num ) == 0 ) return 0; |
| 48 | |
| 49 | if( sscanf( num, " %d", count ) == 0 ) { |
| 50 | notify_fail( "schage wurzel <zahl>\n" ); |
| 51 | return 0; |
| 52 | } |
| 53 | |
| 54 | _wurzel = count; |
| 55 | say( Name(WER) + " schlaegt hier Wurzeln.\n" ); |
| 56 | write( "Du schlaegst nun Wurzeln.\n" ); |
| 57 | return 1; |
| 58 | } |
| 59 | |
| 60 | static int wurzel_aus( string arg ) { |
| 61 | |
| 62 | if( this_object() != this_interactive() ) return 0; |
| 63 | notify_fail( "WAS willst du loesen?\n" ); |
| 64 | if( !arg ) return 0; |
| 65 | if( member( ({"wurzel","wurzeln"}), arg ) == -1 ) return 0; |
| 66 | |
| 67 | _wurzel = -1; |
| 68 | say( Name(WER) + " loest " + QueryPronoun(FEMALE,WEN,PLURAL) |
| 69 | + " Wurzeln aus dem Boden.\n" ); |
| 70 | write( "Du loest Deine Wurzeln aus dem Boden.\n" ); |
| 71 | return 1; |
| 72 | } |
| 73 | |
| 74 | int wurzel_info( string arg ) { |
| 75 | if( this_object() != this_interactive() ) return 0; |
| 76 | switch( _wurzel ) { |
| 77 | case -1: |
| 78 | write( "Deine Wurzeln sind lose.\n" ); |
| 79 | break; |
| 80 | case 0: |
| 81 | write( "Deine Wurzeln sitzen fest.\n" ); |
| 82 | break; |
| 83 | case 1: |
| 84 | write( "Noch eine Bewegung und Du sitzt fest.\n" ); |
| 85 | break; |
| 86 | default: |
| 87 | printf( "Noch %d Bewegungen, und Du sitzt fest.\n", _wurzel ); |
| 88 | } |
| 89 | return 1; |
| 90 | } |
| 91 | |
| 92 | static mixed _query_localcmds() { |
| 93 | return ::_query_localcmds() + ({ |
| 94 | ({ "schlag" , "wurzel_an" ,1,ARCH_LVL }), |
| 95 | ({ "loes" , "wurzel_aus" ,1,ARCH_LVL }), |
| 96 | ({ "wurzelinfo", "wurzel_info",0,ARCH_LVL }) |
| 97 | }); |
| 98 | } |
| 99 | |
| 100 | varargs int move( mixed dest, int method, string dir, |
| 101 | string textout, string textin ) |
| 102 | { |
| 103 | if( _wurzel == 0 ) { |
| 104 | return ME_TOO_HEAVY; |
| 105 | } |
| 106 | if( _wurzel > 0 ) { _wurzel--; } |
| 107 | return ::move( dest, method, dir, textout, textin ); |
| 108 | } |
| 109 | |
| 110 | static int new_quit() { |
| 111 | _wurzel = -1; |
| 112 | return ::new_quit(); |
| 113 | } |