Пример #1
0
void Character::apply_mods( const trait_id &mut, bool add_remove )
{
    int sign = add_remove ? 1 : -1;
    int str_change = get_mod(mut, "STR");
    str_max += sign * str_change;
    per_max += sign * get_mod(mut, "PER");
    dex_max += sign * get_mod(mut, "DEX");
    int_max += sign * get_mod(mut, "INT");

    if( str_change != 0 ) {
        recalc_hp();
    }
}
Пример #2
0
void switch_mod_gate_by_type(mod_type_t type, int flag)
{
	if (flag)
		get_mod(&mod_records[type]);
	else
		put_mod(&mod_records[type]);
}
Пример #3
0
static void _switch_mod_gate_by_type(mod_type_t type, int flag, int dc_protect)
{
    if (mod_records[type].dc_en <= 0 && dc_protect)
        return;
    else {
        if (flag)
            get_mod(&mod_records[type]);
        else
            put_mod(&mod_records[type]);
    }
}
Пример #4
0
void switch_mod_gate_by_name(const char* mod_name, int flag)
{
	int i = 0;
	//PRINT_INFO("arg mod_name is %s\n", mod_name);
	while(mod_records[i].name && i < MOD_MAX_NUM) {
		//PRINT_INFO("mod%d name is %s\n", i, mod_records[i].name);
		if (!strncmp(mod_name, mod_records[i].name, strlen(mod_name))) {
			if (flag)
				get_mod(&mod_records[i]);
			else
				put_mod(&mod_records[i]);
			break;
		}
		i++;
	}
}
Пример #5
0
static void _switch_mod_gate_by_type(mod_type_t type, int flag, int dc_protect)
{
    int i = 0;
    while(mod_records[i].name && i < MOD_MAX_NUM){
        if (type == mod_records[i].type) {
            if (mod_records[i].dc_en <= 0 && dc_protect)
                break;
            else {
                if (flag)
                    get_mod(&mod_records[i]);
                else
                    put_mod(&mod_records[i]);
                break;
            }
        }
        i++;
    }
}