/* * Restore mental presence will allow the caster to remove any stun affect on a * character (from bash, etc.). It will not be much use on themselves since they * have to be ablet to cast it and stun may stop that. We will also have this spell * alleviate certain other affects like disorientation. */ void spell_restore_mental_presence(int sn, int level, CHAR_DATA * ch, void *vo, int target) { CHAR_DATA *victim = (CHAR_DATA *)vo; if (IS_NPC(victim)) { send_to_char("You cannot cast this spell on them.\r\n", ch); return; } // This is all the code needed, it will remove the stun state from the player. victim->daze = 0; // Disorientation isn't a spell, we aren't going to make a saves check but we will // add some fate to it. if (CHANCE(33)) { if (is_affected(victim, gsn_disorientation)) { affect_strip(victim, gsn_disorientation); } } send_to_char("Your mental presence has been restored.\r\n", victim); act("$n's mental presence has been restored.", victim, NULL, NULL, TO_ROOM); } // end spell_restore_mental_presence
void drop_scrap(Player *player) { if (CHANCE(3)) { unsigned addmoney = rand_born(5, 20); printf("\t- Vous prenez %u scraps\n", addmoney); player->money += addmoney; } }
void drop_scrap(Player *player) { if (CHANCE(3)) { unsigned addmoney = rand_born(20, 60); printf("\t- Vous trouvez %u$\n", addmoney); player->money += addmoney; } }
void drop_staff(Player *player) { if (CHANCE(7)) { Staff staff = staff_create(); char c; printf("Vous trouvez un membre du vaisseau: "); staff_set_life(&staff, rand_born(10, 80)); staff_display(staff); printf("Voulez vous le recruter [o/n]?"); scanf("%c", &c); purge_stdin(); if (c == 'o') { if (CHANCE(10)) { int rep = rand_born(1, 2); int money; static const char *sentence[] = { "C'etait un piege! La personne que vous venez de recruter est une kamikaze!\nElle explose dans le vaisseau et fait de serieux degats...", "La personne vous remercies, et vous donnes %d d'argent." }; switch (rep) { case 1: puts(sentence[rep - 1]); ship_get_damage(&player->ship, rand_born(50, player->ship.hull.life.max / 2)); break; case 2: money = rand_born(100, 1000); player->money += money; printf(sentence[rep - 1], money); break; default: break; } } crew_add_staff(&player->ship.crew, staff); } } }
void drop_fuel(Player *player) { if (CHANCE(3)) { if (player->hull.fuel.actual < player->hull.fuel.max) { float fuel = rand_float(10.f, 30.f); printf("\t- Vous recuperez %.1f fuel\n", fuel); player_setFuel(player, player->hull.fuel.actual + fuel, player->hull.fuel.max); } } }
void drop_weapon(Player *player) { if (CHANCE(10)) { Weapon w = weapon_create_rand(player->lvl); char c; printf("Vous trouvez une arme: "); weapon_display(w); printf("Voulez vous la prendre [o/n]? "); scanf("%c", &c); if (c == 'o') { player_setItem(player, I_WEAPON, &w); } } }
void drop_staff(Player *player) { if (CHANCE(8)) { Staff staff = staff_create(); char c; printf("Vous trouvez un membre du vaisseau: "); staff_set_life(&staff, rand_born(10, 80)); staff_display(staff); printf("Voulez vous le recruter [o/n]?"); scanf("%c", &c); if (c == 'o') { crew_add_staff(&player->crew, staff); } } }
void drop_weapon(Player *player) { if (CHANCE(10)) { Weapon w = weapon_create_rand(player->lvl); char c; printf("\nVous trouvez une arme: "); weapon_display(w); printf("Voulez vous la prendre [o/n]? "); scanf("%c", &c); purge_stdin(); if (c == 'o') { ship_set_item(&player->ship, I_WEAPON, 0, &w); } } }
/* * Function finds out if a seed will grow into something else. */ void seed_grow_check(OBJ_DATA *obj) { OBJ_DATA *obj_temp; int chance = 0; int count = 0; // Initial checks to ditch out, object must exist, room must exist // and the seed must be buried. Also no growing in certain sectors // should an item somehow get buried there. if (obj == NULL || obj->in_room == NULL || obj->item_type != ITEM_SEED || !IS_OBJ_STAT(obj, ITEM_BURIED)) { return; } // Places it should never be buried. if (obj->in_room->sector_type == SECT_INSIDE || obj->in_room->sector_type == SECT_WATER_SWIM || obj->in_room->sector_type == SECT_WATER_NOSWIM || obj->in_room->sector_type == SECT_UNDERWATER || obj->in_room->sector_type == SECT_AIR) { bugf("Item buried in a sector_type (%d) it shouldn't be at room %d", obj->in_room->sector_type, obj->in_room->vnum); return; } // If the object doesn't have a vnum set to grow, report it, extract it. if (obj->value[0] == 0) { bugf("Seed vnum %d does not have a vnum set for the item to grow, extracting object.", obj->pIndexData->vnum); separate_obj(obj); extract_obj(obj); return; } // Setup the base chance based off of sector type of the room it's planted in. switch (obj->in_room->sector_type) { case SECT_DESERT: chance -= 75; break; case SECT_BEACH: chance -= 50; break; case SECT_FIELD: chance += 35; break; case SECT_MOUNTAIN: chance -= 15; break; case SECT_HILLS: case SECT_FOREST: chance += 25; break; default: chance = 0; break; } if (IS_OBJ_STAT(obj, ITEM_BLESS)) { chance += 5; } if (IS_OBJ_STAT(obj, ITEM_GLOW)) { chance += 5; } if (IS_OBJ_STAT(obj, ITEM_EVIL)) { chance -= 5; } // Add the immortal initial set chance plus randomness. chance += obj->value[1]; chance += number_range(1, 20); // Count any other seeds that might be buried in the room. for (obj_temp = obj->in_room->contents; obj_temp; obj_temp = obj_temp->next_content) { if (obj_temp->item_type == ITEM_SEED && IS_OBJ_STAT(obj_temp, ITEM_BURIED)) { count++; } } // The more seeds that are planted the less chance any will grow. if (count > 3) { chance -= (3 * count); } // Seeds have a greaater chance of growing during the day. if (IS_DAY()) { chance += 15; } else { chance -= 15; } // Always at least 1 percent chance, always a chance for failure chance = URANGE(1, chance, 95); // The moment of truth. if (!CHANCE(chance)) { return; } // Remove the buried bit, it's going to get extracted but we want people to be able // to see it's short description in the act message and they won't unless it's not buried. separate_obj(obj); REMOVE_BIT(obj->extra_flags, ITEM_BURIED); // Show the room that something has sprouted. if (obj->in_room != NULL && obj->in_room->people != NULL) { act("$p sprouts and grows from the ground!", obj->in_room->people, obj, NULL, TO_ALL); } // Create the new object that has been grown, set it's intiial values and // put it in the room. obj_temp = create_object(get_obj_index(obj->value[0])); obj_to_room(obj_temp, obj->in_room); obj_temp->cost = ((obj->cost * 3) / 2); obj_temp->timer = number_range(75, 200); // Life span of the grown item // Extract the seed (it's already been separated, it's job in this world is complete. extract_obj(obj); return; }