MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / debugShot

Method debugShot

game/ui/tileview/battleview.cpp:2451–2467  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2449}
2450
2451void BattleView::debugShot(Vec3<float> velocity)
2452{
2453 auto blaster = StateRef<AEquipmentType>(state.get(), "AEQUIPMENTTYPE_DEBUGGER_CANNON");
2454 fw().soundBackend->playSample(blaster->fire_sfx, selectedTilePosition);
2455 velocity *= blaster->speed * PROJECTILE_VELOCITY_MULTIPLIER;
2456 Vec3<float> position = {0.5f, 0.5f, 0.5f};
2457 position += selectedTilePosition;
2458 auto p = mksp<Projectile>(
2459 blaster->guided ? Projectile::Type::Missile : Projectile::Type::Beam,
2460 StateRef<BattleUnit>(state.get(), state->current_battle->units.begin()->first),
2461 StateRef<BattleUnit>(), position + velocity, position, velocity, blaster->turn_rate,
2462 blaster->ttl, blaster->damage, blaster->projectile_delay, blaster->explosion_depletion_rate,
2463 blaster->tail_size, blaster->projectile_sprites, blaster->impact_sfx,
2464 blaster->explosion_graphic, blaster->damage_type);
2465 state->current_battle->map->addObjectToMap(p);
2466 state->current_battle->projectiles.insert(p);
2467}
2468
2469void BattleView::orderMove(Vec3<int> target, bool strafe, bool demandGiveWay)
2470{

Callers

nothing calls this directly

Calls 5

addObjectToMapMethod · 0.80
insertMethod · 0.80
getMethod · 0.45
playSampleMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected