MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / finalizeCreation

Method finalizeCreation

source/game/StarPlayer.cpp:2454–2485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2452}
2453
2454void Player::finalizeCreation() {
2455 m_blueprints = make_shared<PlayerBlueprints>();
2456 m_techs = make_shared<PlayerTech>();
2457
2458 auto itemDatabase = Root::singleton().itemDatabase();
2459 for (auto const& descriptor : m_config->defaultItems)
2460 m_inventory->addItems(itemDatabase->item(descriptor));
2461
2462 for (auto const& descriptor : Root::singleton().speciesDatabase()->species(m_identity.species)->defaultItems())
2463 m_inventory->addItems(itemDatabase->item(descriptor));
2464
2465 for (auto const& descriptor : m_config->defaultBlueprints)
2466 m_blueprints->add(descriptor);
2467
2468 for (auto const& descriptor : Root::singleton().speciesDatabase()->species(m_identity.species)->defaultBlueprints())
2469 m_blueprints->add(descriptor);
2470
2471 refreshEquipment();
2472
2473 m_state = State::Idle;
2474 m_emoteState = HumanoidEmote::Idle;
2475
2476 m_statusController->setPersistentEffects("armor", m_armor->statusEffects());
2477 m_statusController->setPersistentEffects("tools", m_tools->statusEffects());
2478 m_statusController->resetAllResources();
2479
2480 m_effectEmitter->reset();
2481
2482 m_description = strf("This {} seems to have nothing to say for {}self.",
2483 m_identity.gender == Gender::Male ? "guy" : "gal",
2484 m_identity.gender == Gender::Male ? "him" : "her");
2485}
2486
2487bool Player::invisible() const {
2488 return m_statusController->statPositive("invisible");

Callers 2

changedMethod · 0.80
TestUniverseMethod · 0.80

Calls 14

singletonClass · 0.85
strfFunction · 0.85
itemDatabaseMethod · 0.80
defaultItemsMethod · 0.80
speciesDatabaseMethod · 0.80
defaultBlueprintsMethod · 0.80
addItemsMethod · 0.45
itemMethod · 0.45
speciesMethod · 0.45
addMethod · 0.45
setPersistentEffectsMethod · 0.45
statusEffectsMethod · 0.45

Tested by 1

TestUniverseMethod · 0.64