/* Galadriel 2-SEP-94: extracted from soul010994b.c */
/* the bash.c contained shield_block instead of bash */

/* G: had to define these too */
#define TP this_player()
#define TPN this_player()->query_name()
#define ENV environment

/* changed args to match call from soul.c
shield_bash() {
*/
bash(int *bash, int no_but) {
	object att;
	int dex;

  if(!att=TP->query_attack()) {
	write("You are not fighting.\n");
	return 1;
	}
  if(!TP->query_armour()[TP->query_arm_types("shield")]) {
	write("You need a shield to bash with.\n");
	return 1;
	}
  if(ENV(TP)!=ENV(att)) {
	write("But your attacker is not here.\n");
	return 1;
	}
  if(ENV(this_player())->query_property("no_fight")) {
    ENV(this_player())->try_attack(att);
    return 1;
	}
  if(bash) {
	write("You loose your balance as you try to attack too soon.\n");
/*	The monster gets a free attack
	att->attack();   
	That was a bit nasty!   Its punishment enough that they cannot but or
	bash for another 3 rounds   */
	bash+=3;
	return 1;
	}
  if(no_but) {
	write("You dont have the self control to bash and butt at the same time.\n");
	return 1;
	}
	
	bash=2;
        dex=TP->query_dex();
        tell_object(att,TPN+" hits you with "+TP->query_possessive()+" shield.\n");
	say(TP->query_name()+" thumps "+att->query_name()+" with a shield.\n");

// Whisky: a sucessfull bashed monster falls
        write("You thump your opponent with your shield.\n");
        if (!random(3) && TP->query_str() > random(att->query_dex()) )
        {
            att->hold(TP,random(2));
            write(att->query_name()+" stumbles and falls !\n");
          }
        TP->add_exp(att->hit_player(random(dex)+dex+5));
	return 1;
	}
