diff options
author | Bendegúz Nagy | 2016-07-12 08:33:45 +0200 |
---|---|---|
committer | Bendegúz Nagy | 2016-08-26 23:02:22 +0200 |
commit | f7e4486d84929b85cc5c82c6a6366eb37f5766de (patch) | |
tree | 93dca4a51748661a40d28c40bec1b4b6f2c3f916 | |
parent | 639fd36f38742669a03814e034bf4dce981d2fea (diff) | |
download | scummvm-rg350-f7e4486d84929b85cc5c82c6a6366eb37f5766de.tar.gz scummvm-rg350-f7e4486d84929b85cc5c82c6a6366eb37f5766de.tar.bz2 scummvm-rg350-f7e4486d84929b85cc5c82c6a6366eb37f5766de.zip |
DM: Add f257_timelineProcessEvent70_light
-rw-r--r-- | engines/dm/timeline.cpp | 33 | ||||
-rw-r--r-- | engines/dm/timeline.h | 1 |
2 files changed, 33 insertions, 1 deletions
diff --git a/engines/dm/timeline.cpp b/engines/dm/timeline.cpp index 0f36220406..8141280f63 100644 --- a/engines/dm/timeline.cpp +++ b/engines/dm/timeline.cpp @@ -337,7 +337,7 @@ void Timeline::f261_processTimeline() { break; case k70_TMEventTypeLight: _vm->_dungeonMan->f173_setCurrentMap(_vm->_dungeonMan->_g309_partyMapIndex); - //F0257_TIMELINE_ProcessEvent70_Light(L0681_ps_Event); + f257_timelineProcessEvent70_light(L0681_ps_Event); _vm->_inventoryMan->f337_setDungeonViewPalette(); break; case k71_TMEventTypeInvisibility: @@ -998,4 +998,35 @@ void Timeline::f254_timelineProcessEvent12_hideDamageReceived(uint16 champIndex) _vm->_championMan->f292_drawChampionState((ChampionIndex)champIndex); } } + +void Timeline::f257_timelineProcessEvent70_light(TimelineEvent* event) { + int16 L0673_i_WeakerLightPower; + int16 L0674_i_Multiple; +#define AL0674_i_LightPower L0674_i_Multiple +#define AL0674_i_LightAmount L0674_i_Multiple + bool L0675_B_NegativeLightPower; + TimelineEvent L0676_s_Event; + + + if ((AL0674_i_LightPower = event->_B._lightPower) == 0) { + return; + } + if (L0675_B_NegativeLightPower = (AL0674_i_LightPower < 0)) { + AL0674_i_LightPower = -AL0674_i_LightPower; + } + L0673_i_WeakerLightPower = AL0674_i_LightPower - 1; + AL0674_i_LightAmount = g39_LightPowerToLightAmount[AL0674_i_LightPower] - g39_LightPowerToLightAmount[L0673_i_WeakerLightPower]; + if (L0675_B_NegativeLightPower) { + AL0674_i_LightAmount = -AL0674_i_LightAmount; + L0673_i_WeakerLightPower = -L0673_i_WeakerLightPower; + } + _vm->_championMan->_g407_party._magicalLightAmount += AL0674_i_LightAmount; + if (L0673_i_WeakerLightPower) { + L0676_s_Event._type = k70_TMEventTypeLight; + L0676_s_Event._B._lightPower = L0673_i_WeakerLightPower; + M33_setMapAndTime(L0676_s_Event._mapTime, _vm->_dungeonMan->_g309_partyMapIndex, _vm->_g313_gameTime + 4); + L0676_s_Event._priority = 0; + _vm->_timeline->f238_addEventGetEventIndex(&L0676_s_Event); + } +} } diff --git a/engines/dm/timeline.h b/engines/dm/timeline.h index 636d62db4f..ed0a5abce3 100644 --- a/engines/dm/timeline.h +++ b/engines/dm/timeline.h @@ -184,6 +184,7 @@ public: bool f258_timelineHasWeaponMovedSlot(int16 champIndex, Champion *champ, uint16 sourceSlotIndex, int16 destSlotIndex); // @ F0258_TIMELINE_HasWeaponMovedToSlot void f254_timelineProcessEvent12_hideDamageReceived(uint16 champIndex); // @ F0254_TIMELINE_ProcessEvent12_HideDamageReceived + void f257_timelineProcessEvent70_light(TimelineEvent *event); // @ F0257_TIMELINE_ProcessEvent70_Light }; |