• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revisione3e36ea4d9f81b651cc98fb26f0233bae98d510d (tree)
Time2014-02-22 20:47:02
Authordis- <dis.rogue@gmai...>
Commiterdis-

Log Message

refactor: RF6_SPECIAL, RF6_TELE*

Change Summary

Incremental Difference

--- a/src/externs.h
+++ b/src/externs.h
@@ -1598,10 +1598,6 @@ extern bool spell_learnable(int m_idx);
15981598 extern int monspell_to_player(int SPELL_NUM, int y, int x, int m_idx);
15991599 extern int monspell_to_monster(int SPELL_NUM, int y, int x, int m_idx, int t_idx);
16001600
1601-extern int spell_RF6_SPECIAL(int y, int x, int m_idx);
1602-extern void spell_RF6_TELE_TO(int m_idx);
1603-extern void spell_RF6_TELE_AWAY(int m_idx);
1604-extern void spell_RF6_TELE_LEVEL(int m_idx);
16051601 extern int spell_RF6_PSY_SPEAR(int y, int x, int m_idx);
16061602 extern void spell_RF6_DARKNESS(int m_idx);
16071603 extern void spell_RF6_TRAPS(int y, int x, int m_idx);
--- a/src/mspells1.c
+++ b/src/mspells1.c
@@ -507,7 +507,7 @@ bool clean_shot(int y1, int x1, int y2, int x2, bool is_friend)
507507 * @param typ 効果属性ID
508508 * @param dam_hp 威力
509509 * @param monspell モンスター魔法のID
510- * @param target_type モンスターからモンスターへ撃つならMONSTER_TO_MONSTER、モンスターからプ・Eぅ筺爾覆・ONSTER_TO_PLAYER
510+ * @param target_type モンスターからモンスターへ撃つならMONSTER_TO_MONSTER、モンスターからプレイヤーならMONSTER_TO_PLAYER
511511 * @return なし
512512 */
513513 void bolt(int m_idx, int y, int x, int typ, int dam_hp, int monspell, int target_type)
@@ -538,7 +538,7 @@ void bolt(int m_idx, int y, int x, int typ, int dam_hp, int monspell, int target
538538 * @param typ 効果属性ID
539539 * @param dam_hp 威力
540540 * @param monspell モンスター魔法のID
541- * @param target_type モンスターからモンスターへ撃つならMONSTER_TO_MONSTER、モンスターからプ・Eぅ筺爾覆・ONSTER_TO_PLAYER
541+ * @param target_type モンスターからモンスターへ撃つならMONSTER_TO_MONSTER、モンスターからプレイヤーならMONSTER_TO_PLAYER
542542 * @return なし
543543 */
544544 void beam(int m_idx, int y, int x, int typ, int dam_hp, int monspell, int target_type)
@@ -572,7 +572,7 @@ void beam(int m_idx, int y, int x, int typ, int dam_hp, int monspell, int target
572572 * @param rad 半径
573573 * @param breath TRUEならばブ・E構萢・.ALSEならばボー・E萢
574574 * @param monspell モンスター魔法のID
575- * @param target_type モンスターからモンスターへ撃つならMONSTER_TO_MONSTER、モンスターからプ・Eぅ筺爾覆・ONSTER_TO_PLAYER
575+ * @param target_type モンスターからモンスターへ撃つならMONSTER_TO_MONSTER、モンスターからプレイヤーならMONSTER_TO_PLAYER
576576 * @return なし
577577 */
578578 void breath(int y, int x, int m_idx, int typ, int dam_hp, int rad, bool breath, int monspell, int target_type)
--- a/src/mspells2.c
+++ b/src/mspells2.c
@@ -739,244 +739,6 @@ bool monst_spell_monst(int m_idx)
739739 switch (thrown_spell)
740740 {
741741
742- /* RF6_SPECIAL */
743- case 160+7:
744- switch (m_ptr->r_idx)
745- {
746- case MON_OHMU:
747- /* Moved to process_monster(), like multiplication */
748- return FALSE;
749-
750- case MON_ROLENTO:
751- if (known)
752- {
753- if (see_either)
754- {
755- disturb(1, 1);
756-
757- msg_format(_("%^sは手榴弾をばらまいた。", "%^s throws some hand grenades."), m_name);
758- }
759- else
760- {
761- mon_fight = TRUE;
762- }
763- }
764-
765- {
766- int num = 1 + randint1(3);
767- for (k = 0; k < num; k++)
768- {
769- count += summon_named_creature(m_idx, y, x, MON_SHURYUUDAN, 0);
770- }
771- }
772-
773- if (known && !see_t && count)
774- {
775- mon_fight = TRUE;
776- }
777- break;
778-
779- default:
780- if (r_ptr->d_char == 'B')
781- {
782- if (one_in_(3))
783- {
784- if (see_m)
785- {
786- msg_format(_("%^sは突然急上昇して視界から消えた!", "%^s suddenly go out of your sight!"), m_name);
787- }
788- teleport_away(m_idx, 10, TELEPORT_NONMAGICAL);
789- p_ptr->update |= (PU_MONSTERS);
790- }
791- else
792- {
793- if (known)
794- {
795- if (see_either)
796- {
797- msg_format(_("%^sが%sを掴んで空中から投げ落とした。", "%^s holds %s, and drops from the sky."), m_name, t_name);
798- }
799- else
800- {
801- mon_fight = TRUE;
802- }
803- }
804-
805- dam = damroll(4, 8);
806-
807- if (t_idx == p_ptr->riding) teleport_player_to(m_ptr->fy, m_ptr->fx, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
808- else teleport_monster_to(t_idx, m_ptr->fy, m_ptr->fx, 100, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
809-
810- sound(SOUND_FALL);
811-
812- if (tr_ptr->flags7 & RF7_CAN_FLY)
813- {
814- if (see_t) msg_format(_("%^sは静かに着地した。", "%^s floats gently down to the ground."), t_name);
815- }
816- else
817- {
818- if (see_t) msg_format(_("%^sは地面に叩きつけられた。", "%^s crashed into the ground."), t_name);
819-
820- dam += damroll(6, 8);
821- }
822-
823- if (p_ptr->riding == t_idx)
824- {
825- int get_damage = 0;
826-
827- /* Mega hack -- this special action deals damage to the player. Therefore the code of "eyeeye" is necessary.
828- -- henkma
829- */
830- get_damage = take_hit(DAMAGE_NOESCAPE, dam, m_name, -1);
831- if (p_ptr->tim_eyeeye && get_damage > 0 && !p_ptr->is_dead)
832- {
833- char m_name_self[80];
834-
835- /* hisself */
836- monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
837-
838- _(msg_format("攻撃が%s自身を傷つけた!", m_name),
839- msg_format("The attack of %s has wounded %s!", m_name, m_name_self));
840-
841- project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
842- set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
843- }
844- }
845-
846- mon_take_hit_mon(t_idx, dam, &fear, extract_note_dies(real_r_ptr(t_ptr)), m_idx);
847- }
848- break;
849- }
850-
851- /* Something is wrong */
852- else return FALSE;
853- }
854-
855- /* done */
856- break;
857-
858- /* RF6_TELE_TO */
859- case 160+8:
860- if (known)
861- {
862- if (see_either)
863- {
864- msg_format(_("%^sが%sを引き戻した。", "%^s commands %s to return."), m_name, t_name);
865- }
866- else
867- {
868- mon_fight = TRUE;
869- }
870- }
871-
872- if (tr_ptr->flagsr & RFR_RES_TELE)
873- {
874- if ((tr_ptr->flags1 & RF1_UNIQUE) || (tr_ptr->flagsr & RFR_RES_ALL))
875- {
876- if (is_original_ap_and_seen(t_ptr)) tr_ptr->r_flagsr |= RFR_RES_TELE;
877- if (see_t)
878- {
879- msg_format(_("%^sには効果がなかった。", "%^s is unaffected!"), t_name);
880- }
881-
882- resists_tele = TRUE;
883- }
884- else if (tr_ptr->level > randint1(100))
885- {
886- if (is_original_ap_and_seen(t_ptr)) tr_ptr->r_flagsr |= RFR_RES_TELE;
887- if (see_t)
888- {
889- msg_format(_("%^sは耐性を持っている!", "%^s resists!"), t_name);
890- }
891-
892- resists_tele = TRUE;
893- }
894- }
895-
896- if (!resists_tele)
897- {
898- if (t_idx == p_ptr->riding) teleport_player_to(m_ptr->fy, m_ptr->fx, TELEPORT_PASSIVE);
899- else teleport_monster_to(t_idx, m_ptr->fy, m_ptr->fx, 100, TELEPORT_PASSIVE);
900- }
901-
902- wake_up = TRUE;
903- break;
904-
905- /* RF6_TELE_AWAY */
906- case 160+9:
907- if (known)
908- {
909- if (see_either)
910- {
911- msg_format(_("%^sは%sをテレポートさせた。", "%^s teleports %s away."), m_name, t_name);
912- }
913- else
914- {
915- mon_fight = TRUE;
916- }
917- }
918-
919- if (tr_ptr->flagsr & RFR_RES_TELE)
920- {
921- if ((tr_ptr->flags1 & RF1_UNIQUE) || (tr_ptr->flagsr & RFR_RES_ALL))
922- {
923- if (is_original_ap_and_seen(t_ptr)) tr_ptr->r_flagsr |= RFR_RES_TELE;
924- if (see_t)
925- {
926- msg_format(_("%^sには効果がなかった。", "%^s is unaffected!"), t_name);
927- }
928-
929- resists_tele = TRUE;
930- }
931- else if (tr_ptr->level > randint1(100))
932- {
933- if (is_original_ap_and_seen(t_ptr)) tr_ptr->r_flagsr |= RFR_RES_TELE;
934- if (see_t)
935- {
936- msg_format(_("%^sは耐性を持っている!", "%^s resists!"), t_name);
937- }
938-
939- resists_tele = TRUE;
940- }
941- }
942-
943- if (!resists_tele)
944- {
945- if (t_idx == p_ptr->riding) teleport_player_away(m_idx, MAX_SIGHT * 2 + 5);
946- else teleport_away(t_idx, MAX_SIGHT * 2 + 5, TELEPORT_PASSIVE);
947- }
948-
949- wake_up = TRUE;
950- break;
951-
952- /* RF6_TELE_LEVEL */
953- case 160+10:
954- if (known)
955- {
956- if (see_either)
957- {
958- msg_format(_("%^sが%sの足を指さした。", "%^s gestures at %s's feet."), m_name, t_name);
959- }
960- else
961- {
962- mon_fight = TRUE;
963- }
964- }
965-
966- if (tr_ptr->flagsr & (RFR_EFF_RES_NEXU_MASK | RFR_RES_TELE))
967- {
968- if (see_t) msg_format(_("%^sには効果がなかった。", "%^s is unaffected!"), t_name);
969- }
970- else if ((tr_ptr->flags1 & RF1_QUESTOR) ||
971- (tr_ptr->level > randint1((rlev - 10) < 1 ? 1 : (rlev - 10)) + 10))
972- {
973- if (see_t) msg_format(_("%^sは効力を跳ね返した!", "%^s resist the effects!"), t_name);
974- }
975- else teleport_level((t_idx == p_ptr->riding) ? 0 : t_idx);
976-
977- wake_up = TRUE;
978- break;
979-
980742 /* RF6_PSY_SPEAR */
981743 case 160+11:
982744 if (known)
--- a/src/mspells4.c
+++ b/src/mspells4.c
@@ -105,7 +105,7 @@ void monspell_message(int m_idx, int t_idx, cptr msg1, cptr msg2, cptr msg3, int
105105
106106 void simple_monspell_message(int m_idx, int t_idx, cptr msg1, cptr msg2, int TARGET_TYPE)
107107 {
108- monspell_message_base(m_idx, t_idx, msg1, msg1, msg2, msg2, p_ptr->blind, TARGET_TYPE);
108+ monspell_message_base(m_idx, t_idx, msg1, msg2, msg1, msg2, p_ptr->blind, TARGET_TYPE);
109109 }
110110
111111 void spell_RF4_SHRIEK(int m_idx, int t_idx, int TARGET_TYPE)
@@ -1543,51 +1543,41 @@ int spell_RF6_WORLD(int m_idx)
15431543 return who;
15441544 }
15451545
1546-int spell_RF6_SPECIAL(int y, int x, int m_idx)
1546+int spell_RF6_SPECIAL_BANORLUPART(int m_idx, int mode)
15471547 {
15481548 monster_type *m_ptr = &m_list[m_idx];
1549- monster_race *r_ptr = &r_info[m_ptr->r_idx];
1550- u32b mode = 0L;
1551- bool direct = player_bold(y, x);
1552- int k, dam, count=0;
1553- char m_name[80];
1554- monster_name(m_idx, m_name);
1555-
1556- disturb(1, 1);
1557- switch (m_ptr->r_idx)
1558- {
1559- case MON_OHMU:
1560- /* Moved to process_monster(), like multiplication */
1561- return -1;
1562- case MON_BANORLUPART:
1563- {
1564- int dummy_hp = (m_ptr->hp + 1) / 2;
1565- int dummy_maxhp = m_ptr->maxhp / 2;
1566- int dummy_y = m_ptr->fy;
1567- int dummy_x = m_ptr->fx;
1568-
1569- if (p_ptr->inside_arena || p_ptr->inside_battle || !summon_possible(m_ptr->fy, m_ptr->fx)) return -1;
1570- delete_monster_idx(cave[m_ptr->fy][m_ptr->fx].m_idx);
1571- summon_named_creature(0, dummy_y, dummy_x, MON_BANOR, mode);
1572- m_list[hack_m_idx_ii].hp = dummy_hp;
1573- m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
1574- summon_named_creature(0, dummy_y, dummy_x, MON_LUPART, mode);
1575- m_list[hack_m_idx_ii].hp = dummy_hp;
1576- m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
1577-
1578- msg_print(_("『バーノール・ルパート』が分裂した!","Banor=Rupart splits in two person!"));
1579- break;
1580- }
1581-
1549+ int dummy_hp, dummy_maxhp, k;
1550+ int dummy_y = m_ptr->fy;
1551+ int dummy_x = m_ptr->fx;
1552+
1553+ switch(m_ptr->r_idx)
1554+ {
1555+ case MON_BANORLUPART:
1556+ dummy_hp = (m_ptr->hp + 1) / 2;
1557+ dummy_maxhp = m_ptr->maxhp / 2;
1558+
1559+ if (p_ptr->inside_arena || p_ptr->inside_battle || !summon_possible(m_ptr->fy, m_ptr->fx))
1560+ return -1;
1561+
1562+ delete_monster_idx(cave[m_ptr->fy][m_ptr->fx].m_idx);
1563+ summon_named_creature(0, dummy_y, dummy_x, MON_BANOR, mode);
1564+ m_list[hack_m_idx_ii].hp = dummy_hp;
1565+ m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
1566+ summon_named_creature(0, dummy_y, dummy_x, MON_LUPART, mode);
1567+ m_list[hack_m_idx_ii].hp = dummy_hp;
1568+ m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
1569+
1570+ msg_print(_("『バーノール・ルパート』が分裂した!","Banor=Rupart splits in two person!"));
1571+ break;
1572+
15821573 case MON_BANOR:
15831574 case MON_LUPART:
1584- {
1585- int dummy_hp = 0;
1586- int dummy_maxhp = 0;
1587- int dummy_y = m_ptr->fy;
1588- int dummy_x = m_ptr->fx;
1575+ dummy_hp = 0;
1576+ dummy_maxhp = 0;
1577+
1578+ if (!r_info[MON_BANOR].cur_num || !r_info[MON_LUPART].cur_num)
1579+ return -1;
15891580
1590- if (!r_info[MON_BANOR].cur_num || !r_info[MON_LUPART].cur_num) return (FALSE);
15911581 for (k = 1; k < m_max; k++)
15921582 {
15931583 if (m_list[k].r_idx == MON_BANOR || m_list[k].r_idx == MON_LUPART)
@@ -1608,146 +1598,312 @@ int spell_RF6_SPECIAL(int y, int x, int m_idx)
16081598
16091599 msg_print(_("『バーノール』と『ルパート』が合体した!", "Banor and Rupart combine into one!"));
16101600 break;
1611- }
1601+ }
1602+ return 0;
1603+}
16121604
1613- case MON_ROLENTO:
1614- if (p_ptr->blind)
1615- msg_format(_("%^sが何か大量に投げた。", "%^s spreads something."), m_name);
1616- else
1617- msg_format(_("%^sは手榴弾をばらまいた。", "%^s throws some hand grenades."), m_name);
16181605
1619- {
1620- int num = 1 + randint1(3);
1606+int spell_RF6_SPECIAL_ROLENTO(int y, int x, int m_idx, int t_idx, int mode, int TARGET_TYPE)
1607+{
1608+ int count = 0, k;
1609+ int num = 1 + randint1(3);
1610+
1611+ monspell_message(m_idx, t_idx,
1612+ _("%^sが何か大量に投げた。", "%^s spreads something."),
1613+ _("%^sは手榴弾をばらまいた。", "%^s throws some hand grenades."),
1614+ _("%^sは手榴弾をばらまいた。", "%^s throws some hand grenades."),
1615+ TARGET_TYPE);
16211616
1622- for (k = 0; k < num; k++)
1623- {
1624- count += summon_named_creature(m_idx, y, x, MON_SHURYUUDAN, mode);
1625- }
1626- }
1617+ for (k = 0; k < num; k++)
1618+ {
1619+ count += summon_named_creature(m_idx, y, x, MON_SHURYUUDAN, mode);
1620+ }
1621+
1622+ if (p_ptr->blind && count)
1623+ msg_print(_("多くのものが間近にばらまかれる音がする。", "You hear many things are scattered nearby."));
1624+
1625+ return 0;
1626+}
1627+
1628+int spell_RF6_SPECIAL_B(int y, int x, int m_idx, int t_idx, int TARGET_TYPE)
1629+{
1630+ int dam;
1631+ monster_type *m_ptr = &m_list[m_idx];
1632+ monster_type *t_ptr = &m_list[t_idx];
1633+ monster_race *tr_ptr = &r_info[t_ptr->r_idx];
1634+ bool monster_to_player = (TARGET_TYPE == MONSTER_TO_PLAYER);
1635+ bool monster_to_monster = (TARGET_TYPE == MONSTER_TO_MONSTER);
1636+ bool direct = player_bold(y, x);
1637+ char m_name[80];
1638+ monster_name(m_idx, m_name);
1639+
1640+ disturb(1, 1);
1641+ if (one_in_(3) || !direct)
1642+ {
1643+ simple_monspell_message(m_idx, t_idx,
1644+ _("%^sは突然視界から消えた!", "%^s suddenly go out of your sight!"),
1645+ _("%^sは突然急上昇して視界から消えた!", "%^s suddenly go out of your sight!"),
1646+ TARGET_TYPE);
1647+
1648+ teleport_away(m_idx, 10, TELEPORT_NONMAGICAL);
1649+ p_ptr->update |= (PU_MONSTERS);
1650+ }
1651+ else
1652+ {
1653+ int get_damage = 0;
1654+ bool fear; /* dummy */
1655+
1656+ simple_monspell_message(m_idx, t_idx,
1657+ _("%^sがあなたを掴んで空中から投げ落とした。", "%^s holds you, and drops from the sky."),
1658+ _("%^sが%sを掴んで空中から投げ落とした。", "%^s holds %s, and drops from the sky."),
1659+ TARGET_TYPE);
1660+
1661+ dam = damroll(4, 8);
1662+
1663+ if (monster_to_player || t_idx == p_ptr->riding)
1664+ teleport_player_to(m_ptr->fy, m_ptr->fx, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
1665+ else
1666+ teleport_monster_to(t_idx, m_ptr->fy, m_ptr->fx, 100, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
1667+
1668+ sound(SOUND_FALL);
1669+
1670+ if ((monster_to_player && p_ptr->levitation) ||
1671+ (monster_to_monster && (tr_ptr->flags7 & RF7_CAN_FLY)))
1672+ {
1673+ simple_monspell_message(m_idx, t_idx,
1674+ _("あなたは静かに着地した。", "You float gently down to the ground."),
1675+ _("%^sは静かに着地した。", "%^s floats gently down to the ground."),
1676+ TARGET_TYPE);
1677+ }
1678+ else
1679+ {
1680+ simple_monspell_message(m_idx, t_idx,
1681+ _("あなたは地面に叩きつけられた。", "You crashed into the ground."),
1682+ _("%^sは地面に叩きつけられた。", "%^s crashed into the ground."),
1683+ TARGET_TYPE);
1684+ dam += damroll(6, 8);
1685+ }
1686+
1687+ if(monster_to_player ||
1688+ (monster_to_monster && p_ptr->riding == t_idx))
1689+ {
1690+ /* Mega hack -- this special action deals damage to the player. Therefore the code of "eyeeye" is necessary.
1691+ -- henkma
1692+ */
1693+ get_damage = take_hit(DAMAGE_NOESCAPE, dam, m_name, -1);
1694+ if (p_ptr->tim_eyeeye && get_damage > 0 && !p_ptr->is_dead)
1695+ {
1696+ char m_name_self[80];
1697+ /* hisself */
1698+ monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
1699+
1700+ msg_format(_("攻撃が%s自身を傷つけた!", "The attack of %s has wounded %s!"), m_name, m_name_self);
1701+
1702+ project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
1703+ set_tim_eyeeye(p_ptr->tim_eyeeye - 5, TRUE);
1704+ }
1705+ }
1706+
1707+ if(monster_to_player && p_ptr->riding)
1708+ mon_take_hit_mon(p_ptr->riding, dam, &fear, extract_note_dies(real_r_ptr(&m_list[p_ptr->riding])), m_idx);
1709+
1710+ if(monster_to_monster)
1711+ mon_take_hit_mon(t_idx, dam, &fear, extract_note_dies(real_r_ptr(t_ptr)), m_idx);
1712+ }
1713+ return dam;
1714+}
1715+
1716+int spell_RF6_SPECIAL(int y, int x, int m_idx, int t_idx, int TARGET_TYPE)
1717+{
1718+ monster_type *m_ptr = &m_list[m_idx];
1719+ monster_race *r_ptr = &r_info[m_ptr->r_idx];
1720+ u32b mode = 0L;
1721+ int count=0;
16271722
1628- if (p_ptr->blind && count)
1629- msg_print(_("多くのものが間近にばらまかれる音がする。", "You hear many things are scattered nearby."));
1723+ disturb(1, 1);
1724+ switch (m_ptr->r_idx)
1725+ {
1726+ case MON_OHMU:
1727+ /* Moved to process_monster(), like multiplication */
1728+ return -1;
16301729
1730+ case MON_BANORLUPART:
1731+ case MON_BANOR:
1732+ case MON_LUPART:
1733+ return spell_RF6_SPECIAL_BANORLUPART(m_idx, mode);
1734+
1735+ case MON_ROLENTO:
1736+ return spell_RF6_SPECIAL_ROLENTO(y, x, m_idx, t_idx, mode, TARGET_TYPE);
16311737 break;
16321738
16331739 default:
16341740 if (r_ptr->d_char == 'B')
16351741 {
1636- disturb(1, 1);
1637- if (one_in_(3) || !direct)
1638- {
1639- msg_format(_("%^sは突然視界から消えた!", "%^s suddenly go out of your sight!"), m_name);
1640- teleport_away(m_idx, 10, TELEPORT_NONMAGICAL);
1641- p_ptr->update |= (PU_MONSTERS);
1642- }
1643- else
1644- {
1645- int get_damage = 0;
1646- bool fear; /* dummy */
1647-
1648- msg_format(_("%^sがあなたを掴んで空中から投げ落とした。",
1649- "%^s holds you, and drops from the sky."), m_name);
1650- dam = damroll(4, 8);
1651- teleport_player_to(m_ptr->fy, m_ptr->fx, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
1652-
1653- sound(SOUND_FALL);
1654-
1655- if (p_ptr->levitation)
1656- {
1657- msg_print(_("あなたは静かに着地した。", "You float gently down to the ground."));
1658- }
1659- else
1660- {
1661- msg_print(_("あなたは地面に叩きつけられた。", "You crashed into the ground."));
1662- dam += damroll(6, 8);
1663- }
1664-
1665- /* Mega hack -- this special action deals damage to the player. Therefore the code of "eyeeye" is necessary.
1666- -- henkma
1667- */
1668- get_damage = take_hit(DAMAGE_NOESCAPE, dam, m_name, -1);
1669- if (p_ptr->tim_eyeeye && get_damage > 0 && !p_ptr->is_dead)
1670- {
1671-#ifdef JP
1672- msg_format("攻撃が%s自身を傷つけた!", m_name);
1673-#else
1674- char m_name_self[80];
1675-
1676- /* hisself */
1677- monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
1678-
1679- msg_format("The attack of %s has wounded %s!", m_name, m_name_self);
1680-#endif
1681- project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
1682- set_tim_eyeeye(p_ptr->tim_eyeeye - 5, TRUE);
1683- }
1684-
1685- if (p_ptr->riding) mon_take_hit_mon(p_ptr->riding, dam, &fear, extract_note_dies(real_r_ptr(&m_list[p_ptr->riding])), m_idx);
1686- }
1742+ return spell_RF6_SPECIAL_B(y, x, m_idx, t_idx, TARGET_TYPE);
16871743 break;
16881744 }
16891745
16901746 /* Something is wrong */
16911747 else return -1;
16921748 }
1693- return dam;
16941749 }
16951750
1696-
1697-void spell_RF6_TELE_TO(int m_idx)
1751+void spell_RF6_TELE_TO(int m_idx, int t_idx, int TARGET_TYPE)
16981752 {
16991753 monster_type *m_ptr = &m_list[m_idx];
1700- char m_name[80];
1701- monster_name(m_idx, m_name);
1702-
1703- disturb(1, 1);
1704- msg_format(_("%^sがあなたを引き戻した。", "%^s commands you to return."), m_name);
1754+ monster_type *t_ptr = &m_list[t_idx];
1755+ monster_race *tr_ptr = &r_info[t_ptr->r_idx];
17051756
1706- teleport_player_to(m_ptr->fy, m_ptr->fx, TELEPORT_PASSIVE);
1707- learn_spell(MS_TELE_TO);
1757+ simple_monspell_message(m_idx, t_idx,
1758+ _("%^sがあなたを引き戻した。", "%^s commands you to return."),
1759+ _("%^sが%sを引き戻した。", "%^s commands %s to return."),
1760+ TARGET_TYPE);
1761+
1762+ if (TARGET_TYPE == MONSTER_TO_PLAYER)
1763+ {
1764+ teleport_player_to(m_ptr->fy, m_ptr->fx, TELEPORT_PASSIVE);
1765+ learn_spell(MS_TELE_TO);
1766+ }
1767+ else if (TARGET_TYPE == MONSTER_TO_MONSTER)
1768+ {
1769+ bool resists_tele = FALSE;
1770+ char t_name[80];
1771+ monster_name(t_idx, t_name);
1772+
1773+ if (tr_ptr->flagsr & RFR_RES_TELE)
1774+ {
1775+ if ((tr_ptr->flags1 & RF1_UNIQUE) || (tr_ptr->flagsr & RFR_RES_ALL))
1776+ {
1777+ if (is_original_ap_and_seen(t_ptr)) tr_ptr->r_flagsr |= RFR_RES_TELE;
1778+ if (see_monster(t_idx))
1779+ {
1780+ msg_format(_("%^sには効果がなかった。", "%^s is unaffected!"), t_name);
1781+ }
1782+ resists_tele = TRUE;
1783+ }
1784+ else if (tr_ptr->level > randint1(100))
1785+ {
1786+ if (is_original_ap_and_seen(t_ptr)) tr_ptr->r_flagsr |= RFR_RES_TELE;
1787+ if (see_monster(t_idx))
1788+ {
1789+ msg_format(_("%^sは耐性を持っている!", "%^s resists!"), t_name);
1790+ }
1791+ resists_tele = TRUE;
1792+ }
1793+ }
1794+
1795+ if (!resists_tele)
1796+ {
1797+ if (t_idx == p_ptr->riding)
1798+ teleport_player_to(m_ptr->fy, m_ptr->fx, TELEPORT_PASSIVE);
1799+ else
1800+ teleport_monster_to(t_idx, m_ptr->fy, m_ptr->fx, 100, TELEPORT_PASSIVE);
1801+ }
1802+ monster_wakeup(t_idx);
1803+ }
17081804 }
17091805
1710-void spell_RF6_TELE_AWAY(int m_idx)
1806+void spell_RF6_TELE_AWAY(int m_idx, int t_idx, int TARGET_TYPE)
17111807 {
1712- char m_name[80];
1713- monster_name(m_idx, m_name);
1714- disturb(1, 1);
1715-
1716- msg_format(_("%^sにテレポートさせられた。", "%^s teleports you away."), m_name);
1717- if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON))
1718- msg_print(_("くっそ〜", ""));
1808+ monster_type *m_ptr = &m_list[m_idx];
1809+ monster_type *t_ptr = &m_list[t_idx];
1810+ monster_race *tr_ptr = &r_info[t_ptr->r_idx];
17191811
1720- learn_spell(MS_TELE_AWAY);
1721- teleport_player_away(m_idx, 100);
1812+ simple_monspell_message(m_idx, t_idx,
1813+ _("%^sにテレポートさせられた。", "%^s teleports you away."),
1814+ _("%^sは%sをテレポートさせた。", "%^s teleports %s away."),
1815+ TARGET_TYPE);
1816+
1817+ if (TARGET_TYPE == MONSTER_TO_PLAYER)
1818+ {
1819+ if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON))
1820+ msg_print(_("くっそ〜", ""));
1821+
1822+ learn_spell(MS_TELE_AWAY);
1823+ teleport_player_away(m_idx, 100);
1824+ }
1825+ else if (TARGET_TYPE == MONSTER_TO_MONSTER)
1826+ {
1827+ bool resists_tele = FALSE;
1828+ char t_name[80];
1829+ monster_name(t_idx, t_name);
1830+
1831+ if (tr_ptr->flagsr & RFR_RES_TELE)
1832+ {
1833+ if ((tr_ptr->flags1 & RF1_UNIQUE) || (tr_ptr->flagsr & RFR_RES_ALL))
1834+ {
1835+ if (is_original_ap_and_seen(t_ptr)) tr_ptr->r_flagsr |= RFR_RES_TELE;
1836+ if (see_monster(t_idx))
1837+ {
1838+ msg_format(_("%^sには効果がなかった。", "%^s is unaffected!"), t_name);
1839+ }
1840+ resists_tele = TRUE;
1841+ }
1842+ else if (tr_ptr->level > randint1(100))
1843+ {
1844+ if (is_original_ap_and_seen(t_ptr)) tr_ptr->r_flagsr |= RFR_RES_TELE;
1845+ if (see_monster(t_idx))
1846+ {
1847+ msg_format(_("%^sは耐性を持っている!", "%^s resists!"), t_name);
1848+ }
1849+ resists_tele = TRUE;
1850+ }
1851+ }
1852+
1853+ if (!resists_tele)
1854+ {
1855+ if (t_idx == p_ptr->riding)
1856+ teleport_player_away(m_idx, MAX_SIGHT * 2 + 5);
1857+ else
1858+ teleport_away(t_idx, MAX_SIGHT * 2 + 5, TELEPORT_PASSIVE);
1859+ }
1860+ monster_wakeup(t_idx);
1861+ }
17221862 }
17231863
1724-void spell_RF6_TELE_LEVEL(int m_idx)
1864+void spell_RF6_TELE_LEVEL(int m_idx, int t_idx, int TARGET_TYPE)
17251865 {
1866+ monster_type *t_ptr = &m_list[t_idx];
1867+ monster_race *tr_ptr = &r_info[t_ptr->r_idx];
17261868 int rlev = monster_level_idx(m_idx);
1727- char m_name[80];
1728- monster_name(m_idx, m_name);
1729-
1730- disturb(1, 1);
1731-
1732- if (p_ptr->blind)
1733- msg_format(_("%^sが何か奇妙な言葉をつぶやいた。", "%^s mumbles strangely."), m_name);
1734- else
1735- msg_format(_("%^sがあなたの足を指さした。", "%^s gestures at your feet."), m_name);
1869+ bool resist, saving_throw;
17361870
1737- if (p_ptr->resist_nexus)
1738- {
1739- msg_print(_("しかし効果がなかった!", "You are unaffected!"));
1740- }
1741- else if (randint0(100 + rlev / 2) < p_ptr->skill_sav)
1871+ if (TARGET_TYPE == MONSTER_TO_PLAYER)
17421872 {
1743- msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
1873+ resist = p_ptr->resist_nexus;
1874+ saving_throw = (randint0(100 + rlev / 2) < p_ptr->skill_sav);
1875+ spell_badstatus_message(m_idx, t_idx,
1876+ _("%^sが何か奇妙な言葉をつぶやいた。", "%^s mumbles strangely."),
1877+ _("%^sがあなたの足を指さした。", "%^s gestures at your feet."),
1878+ _("しかし効果がなかった!", "You are unaffected!"),
1879+ _("しかし効力を跳ね返した!", "You resist the effects!"),
1880+ resist, saving_throw, TARGET_TYPE);
1881+
1882+ if (!resist && !saving_throw)
1883+ {
1884+ teleport_level(0);
1885+ }
1886+ learn_spell(MS_TELE_LEVEL);
1887+ update_smart_learn(m_idx, DRS_NEXUS);
17441888 }
1745- else
1889+ else if (TARGET_TYPE == MONSTER_TO_MONSTER)
17461890 {
1747- teleport_level(0);
1891+ resist = tr_ptr->flagsr & (RFR_EFF_RES_NEXU_MASK | RFR_RES_TELE);
1892+ saving_throw = (tr_ptr->flags1 & RF1_QUESTOR) ||
1893+ (tr_ptr->level > randint1((rlev - 10) < 1 ? 1 : (rlev - 10)) + 10);
1894+
1895+ spell_badstatus_message(m_idx, t_idx,
1896+ _("%^sが%sの足を指さした。", "%^s gestures at %s's feet."),
1897+ _("%^sには効果がなかった。", "%^s is unaffected!"),
1898+ _("%^sは効力を跳ね返した!", "%^s resist the effects!"),
1899+ "",
1900+ resist, saving_throw, TARGET_TYPE);
1901+
1902+ if (!resist && !saving_throw)
1903+ {
1904+ teleport_level((t_idx == p_ptr->riding) ? 0 : t_idx);
1905+ }
17481906 }
1749- learn_spell(MS_TELE_LEVEL);
1750- update_smart_learn(m_idx, DRS_NEXUS);
17511907 }
17521908
17531909 int spell_RF6_PSY_SPEAR(int y, int x, int m_idx)
@@ -2473,10 +2629,10 @@ int monspell_to_player(int SPELL_NUM, int y, int x, int m_idx)
24732629 case 160 + 4: spell_RF6_BLINK(m_idx, MONSTER_TO_PLAYER); break; /* RF6_BLINK */
24742630 case 160 + 5: spell_RF6_TPORT(m_idx, MONSTER_TO_PLAYER); break; /* RF6_TPORT */
24752631 case 160 + 6: return spell_RF6_WORLD(m_idx); break; /* RF6_WORLD */
2476- case 160 + 7: return spell_RF6_SPECIAL(y, x, m_idx); /* RF6_SPECIAL */
2477- case 160 + 8: spell_RF6_TELE_TO(m_idx); break; /* RF6_TELE_TO */
2478- case 160 + 9: spell_RF6_TELE_AWAY(m_idx); break; /* RF6_TELE_AWAY */
2479- case 160 + 10: spell_RF6_TELE_LEVEL(m_idx); break; /* RF6_TELE_LEVEL */
2632+ case 160 + 7: return spell_RF6_SPECIAL(y, x, m_idx, 0, MONSTER_TO_PLAYER); /* RF6_SPECIAL */
2633+ case 160 + 8: spell_RF6_TELE_TO(m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_TELE_TO */
2634+ case 160 + 9: spell_RF6_TELE_AWAY(m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_TELE_AWAY */
2635+ case 160 + 10: spell_RF6_TELE_LEVEL(m_idx, 0, MONSTER_TO_PLAYER); break; /* RF6_TELE_LEVEL */
24802636 case 160 + 11: spell_RF6_PSY_SPEAR(y, x, m_idx); break; /* RF6_PSY_SPEAR */
24812637 case 160 + 12: spell_RF6_DARKNESS(m_idx); break; /* RF6_DARKNESS */
24822638 case 160 + 13: spell_RF6_TRAPS(y, x, m_idx); break; /* RF6_TRAPS */
@@ -2577,6 +2733,10 @@ int monspell_to_monster(int SPELL_NUM, int y, int x, int m_idx, int t_idx)
25772733 case 160 + 4: spell_RF6_BLINK(m_idx, MONSTER_TO_MONSTER); break; /* RF6_BLINK */
25782734 case 160 + 5: spell_RF6_TPORT(m_idx, MONSTER_TO_MONSTER); break; /* RF6_TPORT */
25792735 case 160 + 6: return -1; break; /* RF6_WORLD */
2736+ case 160 + 7: return spell_RF6_SPECIAL(y, x, m_idx, t_idx, MONSTER_TO_MONSTER); /* RF6_SPECIAL */
2737+ case 160 + 8: spell_RF6_TELE_TO(m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF6_TELE_TO */
2738+ case 160 + 9: spell_RF6_TELE_AWAY(m_idx, t_idx, MONSTER_TO_MONSTER); break; /* RF6_TELE_AWAY */
2739+ case 160 + 10: spell_RF6_TELE_LEVEL(m_idx, t_idx, MONSTER_TO_PLAYER); break; /* RF6_TELE_LEVEL */
25802740 }
25812741 return 0;
25822742 }
\ No newline at end of file
Show on old repository browser