Re: Anybody have a better ASPELL(control_weather)

From: Remko M. Wiersma (ia_remko@cs.utwente.nl)
Date: 02/20/97


>   Ok.. What i have noticed was that.. thecontrol weather spell does not
> work at all.. actually it is only defineed in spells.h and 
> in the parser file  just to fit the minimum requirements..
> 
> Now.. as its listed as a manual spell..
> i figured it would be in the spells.c
> file.. but its  not...   soooo before i was going to write it from scratch
> i was wandering if perhaps somebody out there already did. and would
> like to share it with me.. save me some time..

Well.... lemme see. We have sort of changed our codebase completely, but if
you're a bit handy with C and/or C++ I guess you might use this one. If
not... well... junk it I guess ;)

int spell_control_weather::execute( Caster *caster, Target *target )
{
	extern void weather_change(void);
	
	int result = CAST_ARG_ERROR;
	
	if(target->cast_at == CA_OTHER) {
		result = CAST_OK;
		
		if(is_abbrev(target->args->argv[0], "worse")) {
			weather_info.change -= dice(caster->level() / 10, 4);
			weather_change();
		}
		else if(is_abbrev(target->args->argv[0], "better")) {
			weather_info.change += dice(caster->level() / 10, 4);
			weather_change();
		}
		else
			result = CAST_ARG_ERROR;
	}
	return result;
}

Greetinx.

Remko M. Wiersma
aka Iluvatar (at zaphod.cs.utwente.nl 4000)

              ------------------------------------------------------*
Remko M. Wiersma                      Student Computer Science at the  
                                                 University of Twente	 
e-mail: ia_remko@cs.utwente.nl
or WWW: http://www.cs.utwente.nl/~ia_remko
*----------------------------------------------
The secret of success is sincerity. 
Once you can simulate that, you've got it made!
+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
|    Or send 'info circle' to majordomo@cspo.queensu.ca     |
+-----------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/18/00 PST