pent newEntityShell(uid parentid, pent e){ e->globalid = currentEntityID++; e->parentid = parentid; e->textureID = defaultEntites[parentid].textureID; e->stats = defaultEntites[parentid].stats; setEntityPos(e, 200, 200); setEntitySize(e, 4); setEntityHealth(e, getEntityMaxHealth(e)); setEntityAbility(e, getEntityMaxAbility(e)); e->inventory = NULL; //TODO if(parentid == 0){ e->inventory = createInventory(12); giveItem(e->inventory, createRandomItem(1)); int slot = giveItem(e->inventory, createRandomItem(0)); moveItem(e->inventory, slot, 4); } e->facing = 0; grantAI(e, AI_NONE); return e; }
void Room::feather1PickedUpRocks() { _awayMission->disableInput = false; loadActorStandAnim(OBJECT_KIRK); giveItem(OBJECT_IROCK); showText(TX_FEA1N022); _awayMission->feather.gotRock = true; }
void Room::muddaUseLenseOnDegrimer() { assert(_roomIndex >= 0 && _roomIndex <= 5); const TextRef text[] = { TX_MUD0N011, // All of these audio files are identical, but there's one for each room. TX_MUD1N013, TX_MUD2N010, TX_MUD3N016, TX_MUD4N009, TX_MUD5N009, }; giveItem(OBJECT_IALIENDV); loseItem(OBJECT_IDEGRIME); loseItem(OBJECT_ILENSES); _awayMission->mudd.missionScore++; showText(text[_roomIndex]); }
void P_TouchSpecialMobj(mobj_t* special, mobj_t* toucher) { player_t* player; coord_t delta; itemtype_t item; delta = special->origin[VZ] - toucher->origin[VZ]; if(delta > toucher->height || delta < -8) { // Out of reach. return; } // Dead thing touching (can happen with a sliding player corpse). if(toucher->health <= 0) return; player = toucher->player; // Identify by sprite. if((item = getItemTypeBySprite(special->sprite)) != IT_NONE) { if(!giveItem(player, item, (special->flags & MF_DROPPED)? true : false)) return; // Don't destroy the item. } else { App_Log(DE2_MAP_WARNING, "P_TouchSpecialMobj: Unknown gettable thing %i", (int) special->type); } if(special->flags & MF_COUNTITEM) { player->itemCount++; player->update |= PSF_COUNTERS; } P_MobjRemove(special, false); //XXX doom plugin checks value of mapSetup player->bonusCount += BONUSADD; }
void Room::feather1Timer1Expired() { giveItem(OBJECT_ISNAKE); loadActorStandAnim(OBJECT_SNAKE); _awayMission->feather.gotSnake = true; }