/* ....[@@@..[@@@..............[@.................. MUD++ is a written from ....[@..[@..[@..[@..[@..[@@@@@....[@......[@.... scratch multi-user swords and ....[@..[@..[@..[@..[@..[@..[@..[@@@@@..[@@@@@.. sorcery game written in C++. ....[@......[@..[@..[@..[@..[@....[@......[@.... This server is an ongoing ....[@......[@..[@@@@@..[@@@@@.................. development project. All ................................................ contributions are welcome. ....Copyright(C).1995.Melvin.Smith.............. Enjoy. ------------------------------------------------------------------------------ Melvin Smith (aka Fusion) msmith@falcon.mercer.peachnet.edu MUD++ development mailing list mudpp-list@spice.com ------------------------------------------------------------------------------ pc_combat.cc */ #include "string.h" #include "llist.h" #include "room.h" #include "random.h" #include "combat.h" #include "pc.h" #include "global.h" // This is just preliminary crap. Testing of interfaces, etc. // No real combat code here yet. void PC::do_wield( String & arg ) { Object * obj; String arg1; String arg2; if( !arg ) { out( "Wield what?\n\r" ); return; } arg.startArgs(); arg1 = arg.getArg(); if( !( obj = getObjInv( arg1 ) ) ) { out( "You don't seem to have the '" ); out( arg1 ); out( "'\n\r" ); return; } // Add support for dual wield skill later. // the code is already in place --Fusion *ZZZZZ* if( getObjWear( EQ_WIELD_R ) ) { out( "You are already wielding something in your right hand.\n\r" ); return; } out( "You grab " ); out( obj->getShort() ); out( " and wield it.\n\r" ); wield( obj, 0 ); } void PC::do_kill( String & arg ) { Char * victim; int dt = -1; if( !arg ) { out( "Kill who?\n\r" ); return; } if( !( victim = in_room->getChar( arg ) ) ) { out( "Nobody here by that name.\n\r" ); return; } String str; str << shortdesc << " screams 'BANZAII' and attacks " << victim->getShort() << "!!\n\r"; addAttack(); in_room->outAllCharExcept( str.chars(), this, victim ); victim->out( shortdesc ); victim->out( " screams 'BANZAII' and attacks you!!!\n\r" ); out( "You scream 'BANZAII' and attack!!!\n\r" ); attack( victim, dt ); // Now check for victim, in case the attack killed him. if( fighting ) fighting->setFighting( this ); // Add a speed check here. // Chars with VERY fast speed will do an instant retaliation }