Jace, the Mindsculptor
Discuss Upcoming Releases, Coding New Cards, Etc.
PLEASE DO NOT REPORT BUGS HERE!
PLEASE DO NOT REPORT BUGS HERE!
Moderators: BAgate, drool66, Aswan jaguar, gmzombie, stassy, CCGHQ Admins
Jace, the Mindsculptor
by IcyManipulat0r » 24 Dec 2009, 22:18
Here is the card, as coded thus far. The unsummon ability is a bit of a hack, we use the cascade function play_spell_for_free() to play card_unsummon() then remove it from the graveyard. Brainstorm is a straight copy of the card_brainstorm() code, both abilities from a functionality standpoint are working flawlessly. The +2 ability is where I'm currently stuck. For some reason the player targeting on activation never happens, and my call to reveal_top_card() never seems to happen either. In any event here's the code (so far, as I haven't attempted the ultimate ability yet).
- Code: Select all
int card_jace_the_mindsculptor(int player, int card, event_t event){
int costs[4] = { 2, 0, -1, -12 };
card_instance_t *instance = get_card_instance(player,card);
if ( event == EVENT_ACTIVATE ) {
int choice;
instance->number_of_targets = 0;
if ( count_counters(player, card) >= 12 ) {
choice = do_dialog(player, player, card, -1, -1, " Scry/Fateseal 1\n Brainstorm\n Unsummon\n Exile Library\n", 1);
}
else {
choice = do_dialog(player, player, card, -1, -1, " Scry/Fateseal 1\n Brainstorm\n Unsummon\n", 1);
}
instance->targets[10].player = choice;
set_counters(player, card, count_counters(player, card) + costs[choice] );
if ( choice == 0 ) {
target_definition_t td;
default_target_definition(player, card, &td,
TYPE_CREATURE);
td.zone = TARGET_ZONE_PLAYERS;
td.allow_cancel = 0;
select_target(player, card, &td, "Choose a target player", NULL);
instance->number_of_targets = 1;
}
}
else if ( event == EVENT_RESOLVE_ACTIVATION ) {
if ( instance->targets[10].player == 0 ) {
int choice;
reveal_top_card(instance->targets[0].player, 0,0);
choice = do_dialog(player, player, card, -1, -1, " Top\nBottom\n", 1);
if ( choice == 1 ){
put_top_card_of_deck_to_bottom(instance->targets[0].player);
}
}
else if ( instance->targets[10].player == 1 ) {
draw_cards(player, 3);
int i;
target_definition_t td;
default_target_definition(player, card, &td, TYPE_ANY);
td.zone = TARGET_ZONE_HAND;
td.illegal_abilities = 0;
td.allow_cancel = 0;
td.allowed_controller = player;
td.preferred_controller = player;
for(i=0;i<2;i++){
select_target(player, card, &td, "Choose a card to put on deck", NULL);
card_instance_t *ninstance = get_card_instance( player, card);
put_on_top_of_deck(player, ninstance->targets[0].card);
hand_count[player]--;
}
}
else if ( instance->targets[10].player == 2 ) {
play_spell_for_free(player,260);
rfg_card_from_grave(player,count_graveyard(player)-1,-1);
}
}
return planeswalker(player, card, event, 3);
}
- IcyManipulat0r
- Posts: 4
- Joined: 24 Dec 2009, 07:32
- Has thanked: 0 time
- Been thanked: 0 time
Re: Jace, the Mindsculptor
by jatill » 25 Dec 2009, 13:17
Well, the player targetting works fine for me,so maybe you should try turning SmartTarget off.
I can't recommend the unsummon hack you're using- you need to write actual code there.
When you choose abilities, only allow choices for legal abilities (ex: don't show unsummon when there is no creature)
I don't know if you plan on writing other cards, but if you do I'd recommend using the new targetting functions (pick_target instead of select_target etc). See fallen_empires.c for examples.
Finally, reveal_top_card isn't the function you want to use. That's for cards like Vampire Nocturnus that permanently reveal a card.
I can't recommend the unsummon hack you're using- you need to write actual code there.
When you choose abilities, only allow choices for legal abilities (ex: don't show unsummon when there is no creature)
I don't know if you plan on writing other cards, but if you do I'd recommend using the new targetting functions (pick_target instead of select_target etc). See fallen_empires.c for examples.
Finally, reveal_top_card isn't the function you want to use. That's for cards like Vampire Nocturnus that permanently reveal a card.
Apps by jatill: http://www.slightlymagic.net/wiki/Other_Apps_by_jatill
Re: Jace, the Mindsculptor
by IcyManipulat0r » 25 Dec 2009, 22:46
Thank you for the advice. I'll look into the smart target issue, and coding the proper targeting mechanism for the unsummon ability was definitely on my todo list. Looking through cards\ and functions\ I'm not seeing fallen_empires.c is it possible I do not have a complete source tree?
- IcyManipulat0r
- Posts: 4
- Joined: 24 Dec 2009, 07:32
- Has thanked: 0 time
- Been thanked: 0 time
Re: Jace, the Mindsculptor
by Salbei » 25 Dec 2009, 23:52
http://rapidshare.com/files/325361372/20091224.zip <- latest version (with latest src)
can be found in this topic :
viewtopic.php?f=25&t=2002
can be found in this topic :
viewtopic.php?f=25&t=2002
Retired a long time ago. I will not reply.
-
Salbei - DEVELOPER
- Posts: 1053
- Joined: 04 Jun 2009, 10:58
- Location: Germany
- Has thanked: 3 times
- Been thanked: 2 times
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 8 guests